How to display specific posts in the sidebar on Tenaz Theme

  • Unknown's avatar

    Hi @staff-totoro, I deleted the “recent posts” query loop from my post template sidebar and replaced it with a “related posts” block. Nothing is appearing in my posts under “recent posts,” even though a lot of my stories overlap in categories and tags. I understand this feature is “automagic” so we don’t get to pick what goes there, some machine somewhere picks and if it can’t find anything, then we’re SOL.

    Is there any kind of sidebar block where I can pick the content to display??

  • Hey @amandaroyal23, I’ve spilt this into its own thread since the last topic is resolved. Yes, this is possible! It’s what I was encouraging you to use before. The basic steps go like this:

    • Decide which posts you want to display
    • Add the same tag to all of those posts
    • Use your query loop to show only that tag

    Can you update us here when you’ve chosen what tag to use?

  • Unknown's avatar

    @supernovia Hello again! This is the suggestion everyone keeps making. However, I don’t see a logic that would work with the problem I’m trying to solve, which is avoiding duplication of the post itself in the sidebar. I’ve even gotten a few of the support people to admit it won’t work. Do you have a sample site where this is working? I’m assuming the query loop would have to be applied to the post template and couldn’t be created to be different for each individual post?

    Here’s the issue as I see it: To avoid duplication, I have to tag the post something different from the sidebar items. To accomplish this, say I tag half the stories “A” and half the stories “B.” Then I tell the query loop to pull all stories tagged “B” so they’ll show up in the sidebar for all my stories “A” but stories “A” will not show in the sidebar. That will avoid duplication in all stories “A,” but what about stories “B”?

    I just don’t think any of this is possible with your block editor. Thanks for any help!

  • Hi again,

    However, I don’t see a logic that would work with the problem I’m trying to solve, which is avoiding duplication of the post itself in the sidebar. I’ve even gotten a few of the support people to admit it won’t work.

    That is correct. Generally speaking blocks do not “talk to each other” in the way you are describing, so that kind of logic is not possible with blocks as the exist today. Because of this they do not have awareness of what post is being displayed (so that it is hidden in sidebar to avoid dupes) and there is no way to retrofit this functionality using blocks alone.

    To avoid duplication, I have to tag the post something different from the sidebar items. To accomplish this, say I tag half the stories “A” and half the stories “B.” Then I tell the query loop to pull all stories tagged “B” so they’ll show up in the sidebar for all my stories “A” but stories “A” will not show in the sidebar. That will avoid duplication in all stories “A,” but what about stories “B”

    That is one workaround you could use, but it’s not perfect, as you point out. I gave some other suggestions here as well: https://wordpress.com/forums/topic/featured-image-caption-not-showing-in-tenaz-theme/?view=all#post-3999505

    Do you have a sample site where this is working?

    Admittedly this kind of functionality is not common on websites generally speaking, not just WordPress but also including other platforms. With this in mind I was hoping to ask you the same question. Can you think of a site where the sidebar hides stories on some pages but not others? If you can provide an example we may be able to take a look and see how they did it.

  • Unknown's avatar

    Thanks for the info. Most news sites will not have any duplication. Check out any story at WSJ or NYT. But obviously they are either building their sites in-house or have full support for whatever they need. I recall that some of the CMSs I’ve worked in in the past have a list of content with boxes you can check or uncheck to make it show as a related story. Avoiding duplication is a common question online. There are various strings and answers, all having to do with CSS code inserted into the post itself (not a block editor). This site looks like it could be a WordPress site, and I don’t see any duplication: https://www.iflscience.com/oxygen-has-now-been-detected-on-both-venuss-day-and-night-sides-71443 But most templates claiming to be news templates will show duplication in the preview itself (see your own Tenaz theme template walk-through.) So I guess I’m wondering if I need to go to an earlier version of WP that doesn’t have blocks if I really want to avoid this.

  • Hi again,

    Check out any story at WSJ or NYT. But obviously they are either building their sites in-house or have full support for whatever they need… This site looks like it could be a WordPress site, and I don’t see any duplication: https://www.iflscience.com/oxygen-has-now-been-detected-on-both-venuss-day-and-night-sides-71443

    That site did not appear to be created using WordPress, but I do see they have the same issue if you view the “most read” tab instead of the “trending” tab in their sidebar widget

    I think in this case you may have been reacting to their “Trending” widget, which is the default display, and this is similar to the Related Posts block that I mentioned previously:

    WP
    Blocks (The Full List) » Related Posts Block
    3 min read
    Related Posts scans all of your posts’ contents, analyzes them, and uses that to display contextual posts your visitors might be interested in reading after they finish the current post. You can insert the Related Posts block into the contents of any page or post. Add a Related Posts Block Add the Related Posts block to a page by clicking on the Add Block button. Alternatively, you can typ

    Their “Most Red” widget, is simpler (like the Query Loop block) in that it will just show what you tell it to show, but does not include logic that prevents duplicates.

    So I guess I’m wondering if I need to go to an earlier version of WP that doesn’t have blocks if I really want to avoid this.

    I definitely would not recommend downgrading, but I noticed your site is using our Business Plan, and that does give you a lot of options for things you can consider. Instead of the Query Loop block you may wish to consider the following plugin searches:

    Similar to the Query Loop, a lot of the “top posts” widgets may not include functionality to filter out dupes. They tend to be more focused on how posts are displayed, as in the design of how they look and don’t usually have much in the way of logic. You will want to check these carefully to see if any exist that do have that kind of filtering to avoid dupes.

    The second search would be options to consider along the lines of suggesting related content (instead of listing recent content) and for this class of widgets, they tend to be logic-driven, likely will try to suppress duplicates, and may offer more options for customization than the Related Posts block we offer already built in.

    I hope these suggestions help!

  • The topic ‘How to display specific posts in the sidebar on Tenaz Theme’ is closed to new replies.