Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1059998

    Hi,

    We have two categories in our blog, News and Stories. Default the sidebar shows the blogposts from all categories. What we like to achieve is to only display the posts of that particular category.
    So when you click on a post associated with the category “News”, you’re send to the single blog page with in the sidebar only posts from that category.
    Same with a post associated with the category “Stories”.

    Is that possible and, if so, how?

    Best regards,

    Steven

    #1061018

    Hey Steven,

    Yes, that’s possible however you’ll need to install and activate a plugin, you can try to use Widget Logic or similar widget plugins.
    If you use widget logic you’ll need to know some conditional tags: https://codex.wordpress.org/Conditional_Tags
    This way you can create 2 widgets, one shows posts for news category and one for stories, then set each widget’s visibility.

    Best regards,
    Nikko

    #1061559

    Hi Nikko,

    Thank you for your answer. I do understand what you mean and how it should work. However I do not know what exactly I should use in the widget logic field. Could you be more elaborate ?

    Thanks in advance!

    Best regards,

    Steven

    #1061774

    Hi Steven,

    I think for the first widget you just show the posts in the News category and in widget logic you just put:

    is_single() && in_category('news')

    then the 2nd one is Stories and the code to use is:

    is_single() && in_category('stories')

    Best regards,
    Nikko

    #1068995

    Hi Nikko,

    Thanks for your answer and sorry for my late reply. I did figure out from this info, that the two pieces of code are most likely the ones to use. However, I really don’t know how to use it.
    I can make two “Latest posts” widgets, one with: is_single() && in_category(‘news’) in the widget logic field and the other with: is_single() && in_category(‘stories’). Both widgets are placed in the Sidebar Blog. See screendump.
    How do I set each widget visibility e.g. get it to work?

    Thanks in advance!

    Regards,

    Steven

    #1069503

    Hi Steven,

    As long as those conditions are met then it would toggle it’s visibility otherwise it won’t show up.
    If it’s not working please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    1. Install and activate ” Temporary Login Without Password “.
    2. Go to ” Users > Temporary Logins ” on the left-side menu.
    3. Click ” Create New “.
    4. Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
      ( do be sure that we have enough time to debug ).
    5. Click ” Submit “.
    6. You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.

    When your issue is fixed, you can always remove the plugin!
    If you prefer to not use the plugin, you can manually create a admin user and post the login credentials in the “private data” field.

    Best regards,
    Nikko

    #1069976

    Hi Nikko,

    Please see PC.

    Best regards,

    Steven

    #1071715

    Hi steviger,

    I apologize for the delayed response and thanks for the admin access.
    It seems to work fine, in private content I posted a link for sample posts on your site with their respective category and you’ll see it works properly there.

    Best regards,
    Nikko

    #1071727

    Hi Nikko,

    No problem and thanks for your time and effort. However, I’m affraid it’s not quite working yet. As you can see with your sample posts, only the title of the widget changes. The list of posts is still a combination of Actueel en Verhalen.

    Best regards,

    Steven

    #1072529

    Hi Steven,

    I see the issue now and it’s not widget logic or the logical condition we added since you’ll see the widget title changed that’s because the two widgets you put are the same and the only difference is the widget title.
    You’ll need to find another widget plugin which allows Posts by Category, then use that widget instead of Recent Posts which doesn’t have the option to select which category it will show.

    Best regards,
    Nikko

    #1078311

    Hi Nikko,

    Thanks, will look into that.

    Cheers,

    Steven

    #1078967

    Hi Steven,

    You’re welcome.
    We’ll keep this thread open until it’s resolved :)

    Best regards,
    Nikko

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.