• Resolved poojaindia

    (@poojaindia)


    I am really surprised that I am trying to show posts of a particular category but it is not showing anywhere. For example,

    I tried to show posts of one category in slider. It showed only recent posts. Now, I have completely removed slider. So this issue needs no more attention.

    I tried to use Hueman Dynamic Tabs and show posts of a particular category, called travel hacking on secondary sidebar. But its showing only recent posts.

    I tried using Hueman posts widget instead of Dynamic tabs but still it is not showing that category posts.

    I tried to select a different category also but it is not showing any category posts at all. It is only showing recent posts.

    Ay help would be appreciated

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi poojaindia. If you can post a link to your site, indicating which categories are supposed to be displayed where, we can take a look at it and see if we can determine the issue.

    Thread Starter poojaindia

    (@poojaindia)

    hey @bdbrown

    the link is Travel Jots.com (remove spaces).

    I wish to display category post (Travel Hacking) on secondary sidebar. But no matter Whichever category I select, Hueman Posts and Hueman Tabs just show recent posts.

    I wish to display category post (Travel Hacking) on secondary sidebar.

    Every post displayed in the secondary sidebar is in category “Travel Hacking”.

    Thread Starter poojaindia

    (@poojaindia)

    Hi there

    No, It is showing only recent posts.

    Don’t be misled with heading of sidebar Which I have kept travel hacking).

    The posts below are all recent posts and not specific to category.

    Regards

    Open each one of the posts in your “Travel Hacking” sidebar. Just above the post content, the page title shows the post categories. Every one of those posts shows category “Travel Hacking” in the page title. Go to your menu and open the Travel Hacking category link. You’ll see the same posts in the category page that are displayed in the sidebar.

    Thread Starter poojaindia

    (@poojaindia)

    Ok I have checkout the thing. It is quite surprising.

    That on the main page of website, secondary sidebar is showing recent posts. But on all other pages it is showing category posts.

    Then my guess would be that you have a different widget area assigned to the home page, and the Hueman Posts widget in that sidebar doesn’t have a category assigned.

    Thread Starter poojaindia

    (@poojaindia)

    Hi

    I tried removing the widgets altogether and setting them again. I sincerely feel that there is no issue with the theme as such. And there is an issue with my child theme. As I have tried the same thing in parent theme and found it to be working fine.

    So I removed the following code from functions.php in my child theme

    /* exclude specific category from WordPress loop */
    function my_exclude_category( $wp_query ) {
      if( is_main_query() && is_home() ) {
        $wp_query->set( 'cat', '-56' );
      }
    }
    add_action( 'pre_get_posts', 'my_exclude_category' );

    However, this code was added there in functions.php to exclude a particular category (misc category) for not showing on Main Page. I don’t know why it is interfering with other widgets. And I would definitely want to keep that functionality as well.

    As of now, I have simply removed this piece of coe. Can you suggest me how to edit this code as to not affect all other things.

    Regards

    Let’s make a slight modification to your function and see if that fixes it.
    Change this line:

    if( is_main_query() && is_home() ) {

    to this:

    if ( $wp_query->is_front_page() && $wp_query->is_main_query() ) {

    See if that modifies only the main posts list and not the widgets.

    Thread Starter poojaindia

    (@poojaindia)

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Category posts not showing on posts , slider and every place’ is closed to new replies.