The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Show all posts by author - including custom posts types (6 posts)

  1. adam533
    Posted 6 years ago #

    I am using the code the_author_posts_link and it is not working for a custom post type I setup. I have authors posting normal posts and also this custom post type (photos). I made sure to set photos as a post type and not page. When clicking the link though it does not return any of the custom posts types. How can I set that up correctly?

  2. Hax
    Posted 6 years ago #

    just creating custom post types will not, you have to be sure that the author is been assign to the post type (photos) also if you want this post type to show in categories(taxomony) you need to sign it to the new custom post type. here is a good plug in that can show you visually want is assign to what and you can modify taxonomy too.


  3. adam533
    Posted 6 years ago #

    Not exactly clear on how to assign an author to the post type (photos in this example). Is this something I would do in the functions file where I created the post type and taxonomies?

  4. Hax
    Posted 6 years ago #

    no when you create a new post wp_insert_post() you have to be sure that you assign your custom post type and author id, check you database to be sure that your new post and post type have an author assign to it.


  5. vlad_paun
    Posted 5 years ago #


    You should try adding this into function.php (or a plugin):

    function add_pagination_to_author_page_query_string($query_string)
        if (isset($query_string['author_name'])) $query_string['post_type'] = array('post','news');
        return $query_string;
    add_filter('request', 'add_pagination_to_author_page_query_string');

    and replace "news" with your custom post type slug.

    Then a wp-pagenavi should work just fine.

  6. ericgallagher
    Posted 5 years ago #


    Thank you for the easy quick fix. It's nice to have simple answers and quick fixes.

Topic Closed

This topic has been closed to new replies.

About this Topic