Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Resolved] Co-authors plus & page headers

Home Forums Support [Resolved] Co-authors plus & page headers

Home Forums Support Co-authors plus & page headers

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #539412
    Kristian

    I read the latest instructions from here and added the code to my child theme’s functions.php.

    With this the authors are visible on the front page of my blog but on articles with Page Header, only the main author is visible. Also only one author box (plugin called Starbox) from the main author is generated on the article.

    Any way to fix this with GP? Any other viable co-author plugins? We are adding two more bloggers to our lineup so this is soon a very needed feature for us!

    GeneratePress 2.0.2
    GP Premium 1.6.2
    #540499
    Tom
    Lead Developer
    Lead Developer

    You could create a shortcode to use in the Page Header content:

    add_shortcode( 'author_plus', 'tu_coauthors_plus_shortcode' );
    function tu_coauthors_plus_shortcode() {
    	return sprintf( ' <span class="byline">%1$s</span>',
    		function_exists( 'coauthors_posts_links' ) ? coauthors_posts_links( null, null, null, null, false ) : ''
    	);
    }

    Then you can use this in the Page Header content: [author_plus]

    As for the other question, you’ll likely need to check with the developers of Starbox.

    #540805
    Kristian

    Ha, thanks a lot! Perfect!

    Is adding shortcodes and filling the functions.php with all kinds of stuff, like the lines Co-authors Plus requires to function, very resource intensive? I wouldn’t like to bloat it too much.

    #541120
    Tom
    Lead Developer
    Lead Developer

    It depends on the functions you’re using in the shortcodes. In this case, it barely makes a difference πŸ™‚

    #546155
    Kristian

    Thanks a lot!

    Ahh, one more thing. After adding the short code to page header, the author name popped back up under the header. Easiest way to remove it? Using a child theme.

    #546458
    Tom
    Lead Developer
    Lead Developer

    You can turn off the author in “Customize > Layout > Blog” πŸ™‚

    #547179
    Kristian

    Ahhh, of course, too simple. Thank you so much. Support alone is worth the license! πŸ™‚

    #547280
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! Thank you πŸ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.