Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #346366

    So I now have all my portfolio entries assigned to a specific author and now I am looking to ensure those portfolio entries appear under the author post links (same as post entries).

    So if you go on my author posts entries (link bellow) I would like to also list the portfolio entries. Ideally this would be done through the child theme.

    Thanks!

    #346393

    Hey momon!

    I am afraid this is not that easy. The author page query is a default wordpress query that does not include any custom post types like the “portfolio” post type. My first idea was to search for a plugin for that but it seems there are none. All I could come up with is a a bunch of tutorials that allow you to add a few filter functions to your functions.php file to add this:

    eg: http://designpx.com/tutorials/custom-post-types-author-archive/ – you need to make sure to also add the “portfolio” post type to the post type array mentioned in the tutorial ;)

    Cheers!
    Kriesi

    #346642

    Thanks Kriesi for the find. Unfortunately it did not work, the author page was remain unchanged when I added the filter.

    I tried this with portfolio as well as other custom post types I have setup and it did not work. I tried it also with ‘page’ as he suggests in the article also but that didn’t yield any different results. Seems like the function is not doing anything at all.

    #348194

    Hi!

    Try changing the code shown in that link to this.

    function enfold_customization_add_portfolios_to_author_query($query) {
        if ($query->is_author)
            $query->set( 'post_type', array('portfolio', 'post') );
        remove_action( 'pre_get_posts', 'custom_post_author_archive' );
    }
    add_action('parse_query', 'enfold_customization_add_portfolios_to_author_query');

    Cheers!
    Elliott

    • This reply was modified 10 years, 1 month ago by Elliott.
    #348246

    Perfect, that worked!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘List of Entries by Author’ is closed to new replies.