To insert code use <code>...</code>.
Blog shortcode not filtering on specific category
  • I am stumped... I have several blog categories such as product review and product info.... however, no matter what category I specify in the shortcode like:

    [blog frame="false" cat="6" category__not_in="34" imageType="default"]

    It still shows both categories, even when I explicitly exclude the one I don't want.... Help?
  • 1 Comment sorted by
  • Hi Brian

    In the Striking Blog General Panel, under the Blog General Settings, you will find a setting for Exclude Categories for Blog Page. You can exclude a category here, and let me know what the effect is to your usage.

    However, you should not need to do this. I just did a test where I have 3 categories:
    Technology, Information, News and a total of 6 posts (I attached the Post summary page #1 Blog Post Summary Page so you would see).

    I created a new page and posted in the following code:

    [blog column="2" grid="true" frame="false" count="10" imageType="default" nopaging="false"]

    which would result in all posts being displayed, as I neither included or excluded any posts. The #2 screenshot shows the code. Since there are 6 blog posts in total, I expected all 6 to display, and they did per Screenshot #3 - Display All Posts Output.

    Now if you look at the screenshots, I have one post "Pertinacia scriptorem proinc" that is in the News category and I will exclude it. So Screenshot#4A is of the blog shortcode where I have excluded the news category (which is category id 4), but included the other 2 categories. And 4b is the actual code appearing in the editor. This should result in the one News blog post being excluded, even though it is assigned to multiple categories. So instead of 6 posts appearing, I should only find 5 appearing. As you can see the blog shortcode to cause the exclusion outputs the following code to the editor:

    [blog column="2" grid="true" blog cat="5,6" category__not_in="4" frame="false" count="10" imageType="default" nopaging="false"]

    Acreenshot #5 is the live page, and as you can see, the output worked correctly, as the one News related blog post was excluded. Only 5 posts showed up.

    BTW, I tried your shortcode exactly as per how you posted, except I changed the "Count" to 10 instead of the default 3, and substituted my category numbers in place of yours, so my code was as follows:

    [blog frame="false" cat="5,6" category__not_in="4" count="10" imageType="default"]

    and I attached both images, marked #6 and #7, and you can see it worked again.

    So my answer is I don't know why this problem is occurring in your use of the shortcode. I believe you are up to date in both your Striking and your WP from what I recall in past threads. So you should not be having this error, unless something is interfering in the blog shortcode output.

    Its actually been some time since we even had a blog question, and I don't recall the last time we had a blog error.

    I took a look at our pm's, and while I have your skype (and have sent you skype messages) I don't believe I have your logins. If you would like me to log in this weekend and look around, together with you on skype, I am happy to do such.

    Happy Striking
    Striking Team
    James
    #1-Blog Post Summary Page.jpg
    1095 x 540 - 183K
    #2 Screenshot-code-display-all-posts.jpg
    1068 x 523 - 162K
    #3-Displlay-All-Posts-Ouput.jpg
    1260 x 2999 - 611K
    #4A-BlogShortcode-excluding-News-Category.jpg
    910 x 656 - 190K
    #4B-TrueEditorCode-excluding-News-Category.jpg
    1099 x 481 - 152K
    #5-Displlay-Posts-with-Exclusion.jpg
    1260 x 2779 - 529K
    #6-BrianEditorCode.jpg
    1064 x 530 - 159K
    #7-Display-Posts-with-Exclusion-BrianCode.jpg
    1260 x 3627 - 687K