• Resolved Regenpfeifer

    (@regenpfeifer)


    Hello,

    is it possible in Chaplin to add an author information / bio box (with information from the user settings) after each post / single page?

    Thank you very much!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @regenpfeifer,

    Sorry for the late reply. There’s no built-in functionality for it, but it’s possible to add in a child theme with custom code hooked to the chaplin_entry_footer action.

    It’s been requested a couple of times, so I might add it as an opt-in option in the Customizer somewhere down the line.

    — Anders

    Thread Starter Regenpfeifer

    (@regenpfeifer)

    Thank you very much, @anlino, it would be a great idea to add an option for the author bio in the customizer.

    Meanwhile, I have added these lines as a code snippet to the functions.php:

    function wpb_author_info_box( $content ) {
      
    global $post;
    
    if ( is_single() && isset( $post->post_author ) ) {
    
    $display_name = get_the_author_meta( 'display_name', $post->post_author );
    if ( empty( $display_name ) )
    $display_name = get_the_author_meta( 'nickname', $post->post_author );
    
    $user_description = get_the_author_meta( 'user_description', $post->post_author );
      
    $author_details = '<p class="author_name">Wer schreibt hier?</p>';
      
    if ( ! empty( $user_description ) )
    $author_details .= '<p class="author_details">' . get_avatar( get_the_author_meta('user_email') , 90 ) . nl2br( $user_description ). '</p>';
    $content = $content . '<footer class="author_bio_section" >' . $author_details . '</footer>';
    }
    
    return $content;
    }
      
    add_action( 'the_content', 'wpb_author_info_box' );
    remove_filter('pre_user_description', 'wp_filter_kses');

    This seams to be a different method to the one you have suggested, but it works.

    Thank you again for this really awesome theme
    and best wishes,
    @regenpfeifer

    Theme Author Anders Norén

    (@anlino)

    Hi @regenpfeifer,

    I decided to include the author bio in version 2.6.0 of Chaplin, which is out now, so you can give it a go by activating it in Appearance → Customizer → Theme Options → Single Posts → “Show Author Bio”.

    — Anders

    Thread Starter Regenpfeifer

    (@regenpfeifer)

    Thank you very much @anlino,

    this seems excellent, but unfortunately, the “Author Bio” is only shown in the Customizer. As soon as I am leaving the Customizer, the Author Bio Box disappears.

    I have tested this with several sites. Maybe there is some setting, that interferes with the display of the Author Bio Box?

    Yours, @regenpfeifer

    Theme Author Anders Norén

    (@anlino)

    Hi @regenpfeifer,

    That’s odd – I tested it on the demo site, which is separate from the development site that the feature was developed on, and the author bio shows up.

    I did notice that the default value of the “Show Author Bio” checkbox in the Customizer is checked in 2.6.0, which doesn’t match the front-end, where the author bio is hidden by default. If you try unchecking the checkbox, and then click “Publish”, and then check it again, and click “Publish” again, it should show up.

    I’ve just submitted version 2.6.1 which changes the default value of the Customizer setting to false, to match the behavior on the front-end (hidden by default).

    — Anders

    Thread Starter Regenpfeifer

    (@regenpfeifer)

    Thank you very much, @anlino,

    now – with version 2.6.1 – the customizer settings are working as expected.

    I think the “Author Bio” option is a really great addition to the Chaplin theme.

    Best whishes, yours, @regenpfeifer

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Author information / bio’ is closed to new replies.