• Hello!

    We just started managing a client’s site and am finding some weird bugs. For instance, whenever you click on a specific category, tag or archive, it will only show the most recent posts regardless of whatever category, tag or archive you have selected. Any ideas as to what could be causing this or how to go about fixing this?! The sooner we can get this fixed the better!

    LINK TO SITE HERE

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • What number do you have for “Blog pages show at most” (“Settings” > “Reading” in your admin page)? This place is the first suspect. If not this one, I’m not quite sure at this point.

    Looks like a filter like pre_get_posts is being applies somewhere which always modifies the category in the query.

    1. First of all, if you have the option to, try switching themes and see if the problem still persists.
    2. If it does, then probably it is one of your plugins that is the culprit.
    On the other hand, it the problem goes away, then it would be the theme.

    3. If it is the plugin, then you disable all plugins and check for the issue. If it goes away, then you are certain that one of the plugins is causing this.
    Now enable them one at a time and at the same time check if the issue comes up.
    The moment the issues comes up, you know that the last plugin to be enabled is to be blamed.

    4. On the other hand, if it is the theme, then you could search for pre_get_posts in the functions.php (or other files) file of the theme.
    See if you find something suspicious there.

    5. You could also install the ‘Query Monitor’ and ‘WP Debug’ family of plugins and see which hooks are coming into play, when you go to a certain category archive.

    6. You might also want to flush and save the permalinks and check if things work fine.

    Thread Starter kclark5463

    (@kclark5463)

    Thanks for responding guys! ??

    In the Blogs pages show at most, is the number 15.

    It has something to do with the theme (tried disabling plugins just to make sure and the error still showed). When I open the functions.php, there’s this line:
    add_action( ‘pre_get_posts’, ‘wpfme_search_results_per_page’ );
    When I remove it just to see what would happen, the problem still persists. Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Widgets only show most recent posts error’ is closed to new replies.