Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #15026

    WordPress automatically attributes posts to authors, and I wanted to know how to ensure that when somebody write a portfolio entry, that that portfolio entry is attributed to them. In other words to make sure that portfolio pages endup in domain/authorname/



    Based on: I’d try to add following function to functions.php:

    function inoplugs_portfolio_for_author( &$query )
    if ( $query->is_author )
    $query->set( 'post_type', 'portfolio' );
    remove_action( 'pre_get_posts', 'inoplugs_portfolio_for_author' ); // run once!
    add_action( 'pre_get_posts', 'inoplugs_portfolio_for_author' );


    Hey Dude,

    This worked beautifully. Thank you so much for your help!

    I have been asking a lot of questions as of late. Is there any way that I can donate more $?



    Glad Dude could help :)

    You can always drop a line to Kriesi here: and let him know how great the support is ;) or to his Twitter:




    I tried to use this solution on the newer versions of WordPress / Angular and it wouldn’t work, but I found another way to make this happen. In the file, register-portfolio.php located in /includes/admin, I went to the following lines of code:

    $args = array(

    ‘labels’ => $labels,

    ‘public’ => true,

    ‘show_ui’ => true,

    ‘capability_type’ => ‘post’,

    ‘hierarchical’ => false,

    ‘rewrite’ => array(‘slug’=>$slugRule,’with_front’=>true),

    ‘query_var’ => true,

    ‘show_in_nav_menus’=> false,

    ‘supports’ => array(‘title’,’thumbnail’,’excerpt’,’editor’,’comments’)

    I changed the final line to read:

    ‘supports’ => array(‘title’,’thumbnail’,’excerpt’,’editor’,’comments’,’author’)

    Maybe this will be useful to others!


    Hi InterdisciplinaryInnovation,

    Thanks for sharing the information. :)



Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Authorship and Profiles’ is closed to new replies.