WP Siloing - How to show recent posts only from the same category as the current post on the sidebar

by satrap
11 replies
  • SEO
  • |
Hi Guys,

I am trying to silo my blog and I have run into a problem.

Usually, WordPress shows recent posts on the sidebar from all categories. But for a silo based site that wont be good as you don't want to be linking posts from different categories to each other.

Is there any way (preferably without plugin) to somehow only show recent or popular posts on post pages from the same category the post belongs to?...

Thank you in advance.
#category #current #post #posts #recent #show #sidebar #siloing
  • Profile picture of the author KurtJames
    Try some of the related posts plugins.

    Here is one that works:
    WordPress › Related Posts by Category « WordPress Plugins

    I personally use YARPP and set the "Category" to the most important setting when determining to display related posts.
    {{ DiscussionBoard.errors[7736914].message }}
    • Profile picture of the author KurtJames
      btw... siloing websites is kind of an old concept.

      in todays panda/penguin world. you are better off creating sub-domains for content that is not related.
      {{ DiscussionBoard.errors[7736919].message }}
  • Profile picture of the author yukon
    Banned
    Try this code here.
    {{ DiscussionBoard.errors[7736952].message }}
    • Profile picture of the author satrap
      Originally Posted by yukon View Post

      Try this code here.
      Thanks Yukon. I tried the code, but for some reason it only shows posts from one specific category no matter what post page I am on. Do you think it may be theme related issue?...
      Signature
      60 Awesome Ways to Make Money Without a Job
      .................................
      Check out my blog Survey Satrap featuring honest reviews of paid survey sites.
      {{ DiscussionBoard.errors[7737303].message }}
      • Profile picture of the author yukon
        Banned
        Originally Posted by satrap View Post

        Thanks Yukon. I tried the code, but for some reason it only shows posts from one specific category no matter what post page I am on. Do you think it may be theme related issue?...
        That code in the other thread works perfect for me. It displays a bullet list of all the WP-Post from the same category of the current WP-Post that I'm viewing in my browser. I pasted the code directly into my single.php file outside of the Loop (below the single.php Loop).

        The code in the other thread is setup to only display the same category WP-Post on the single.php page but I can add the category.php If needed (very small php edit).
        {{ DiscussionBoard.errors[7737326].message }}
  • Profile picture of the author Fraggler
    If you want to jump between categories then you can also use a conditional widgets plugin and custom menus. I don't have access to the ones I use atm but yell out if you want me to find them.
    {{ DiscussionBoard.errors[7737281].message }}
  • Profile picture of the author yukon
    Banned
    Post your single.php file as a plain text file, I'll take a look.
    {{ DiscussionBoard.errors[7737331].message }}
    • Profile picture of the author satrap
      Originally Posted by yukon View Post

      Post your single.php file as a plain text file, I'll take a look.
      Thanks for the offer Yukon. Its attached.
      Signature
      60 Awesome Ways to Make Money Without a Job
      .................................
      Check out my blog Survey Satrap featuring honest reviews of paid survey sites.
      {{ DiscussionBoard.errors[7745314].message }}
      • Profile picture of the author yukon
        Banned
        Originally Posted by satrap View Post

        Thanks for the offer Yukon. Its attached.

        Try adding the code I already suggested 1 line above the last line of code (outside the post loop) in the single.php file that you attached to your last comment.

        I didn't test it because your code is calling a bunch of custom code which will throw errors on my test site.
        {{ DiscussionBoard.errors[7745536].message }}
        • Profile picture of the author satrap
          Originally Posted by yukon View Post

          Try adding the code I already suggested 1 line above the last line of code (outside the post loop) in the single.php file that you attached to your last comment.

          I didn't test it because your code is calling a bunch of custom code which will throw errors on my test site.
          Thanks again Yukon.

          It works under the content of the single post. But I was trying to replace it with the sidebar's "recent posts", which when added to the sidebar it doesn't work. It just shows from one specific category no matter the post page.

          I guess I have to just leave it the way it is. I mean, I do inter link posts from the same category to each other. But I just wanted to have that in the sidebar instead of recent posts showing from whatever category.

          Thanks again Yukon.
          Signature
          60 Awesome Ways to Make Money Without a Job
          .................................
          Check out my blog Survey Satrap featuring honest reviews of paid survey sites.
          {{ DiscussionBoard.errors[7745714].message }}
          • Profile picture of the author yukon
            Banned
            Originally Posted by satrap View Post

            Thanks again Yukon.

            It works under the content of the single post. But I was trying to replace it with the sidebar's "recent posts", which when added to the sidebar it doesn't work. It just shows from one specific category no matter the post page.

            I guess I have to just leave it the way it is. I mean, I do inter link posts from the same category to each other. But I just wanted to have that in the sidebar instead of recent posts showing from whatever category.

            Thanks again Yukon.

            It will work in the sidebar, post the sidebar.php.
            {{ DiscussionBoard.errors[7746091].message }}

Trending Topics