Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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/

    Thanks

    #85907

    Based on: http://wordpress.stackexchange.com/questions/11210/including-post-type-wiki-in-author-archives 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' );

    #85908

    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 $?

    Thanks

    #85909

    Glad Dude could help :)

    You can always drop a line to Kriesi here: http://www.kriesi.at/contact and let him know how great the support is ;) or to his Twitter: https://twitter.com/Kriesi

    Regards,

    Devin

    #85910

    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!

    #85911

    Hi InterdisciplinaryInnovation,

    Thanks for sharing the information. :)

    Cheers,

    Ismael

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

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