• I am making a newspaper. I am using a custom post type option. Where the author name link is under the post. I am admin..When i click the link of my name, all posts of mine are showing in a page. But other people which user role is Author. After clicking their name link under their posts..all posts of them not showing.

    How i can add the feature to my website.. Please help

    • This topic was modified 5 years, 9 months ago by mridulmet.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Apparently the query used is restricting results in an unexpected way. Check the SQL query made to learn what that restriction is. Its nature should be a good clue towards the cause, or at least how you can negate the restriction through the “pre_get_posts” action.

    To see the query, temporarily insert this code on the template used for author queries:

    <?php
      global $wp_query;
      echo '<pre>', $wp_query->request, '</pre>';
    ?>

    If you’re not sure which template, there are plugins that help you learn which are used for any given request. “Show Current Template” is one of several possibilities. Place my code just above where the loop starts which would output author posts. Location isn’t too critical, but if the location is already in a <?php ?> block, remove those tags from my code.

Viewing 1 replies (of 1 total)

The topic ‘Author All posts not showing after clicking author link’ is closed to new replies.