• Resolved tonyx4x44

    (@tonyx4x44)


    Author box by default only appear on post

    how do my make them appear on pages also???

    thanks

    link

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter tonyx4x44

    (@tonyx4x44)

    any help?

    Ian MacGregor

    (@ardchoille)

    I would suggest contacting the theme developer. From what I can see, your request is going to include adding php code into class-content-page.php. The posts seem to have the author bio included already.

    Menaka S.

    (@menakas)

    Hi tonyx4x44,
    Try adding this to your child theme’s functions.php

    add_action ('__before_body' , 'add_author_box_page');
    function add_author_box_page() {
    	if (is_page()) {
    		add_action('__after_content' , 'tc_page_footer' );
    	}
    return;
    }
    function tc_page_footer() {
    	if ( ! get_the_author_meta( 'description' ) )
            return;
    	$html = sprintf('<footer class="entry-meta">%1$s<div class="author-info"><div class="%2$s">%3$s %4$s</div></div></footer>',
                       '<hr class="featurette-divider">',
    				apply_filters( 'tc_author_meta_wrapper_class', 'row-fluid' ),
    				sprintf('<div class="%1$s">%2$s</div>',
    					apply_filters( 'tc_author_meta_avatar_class', 'comment-avatar author-avatar span2'),
    					get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'tc_author_bio_avatar_size' , 100 ) )
    				),
    				sprintf('<div class="%1$s"><h3>%2$s</h3><p>%3$s</p><div class="author-link">%4$s</div></div>',
    					apply_filters( 'tc_author_meta_content_class', 'author-description span10' ),
    					sprintf( __( 'About %s' , 'customizr' ), get_the_author() ),
    					get_the_author_meta( 'description' ),
    					sprintf( '<a href="%1$s" rel="author">%2$s</a>',
    						esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    						sprintf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>' , 'customizr' ), get_the_author() )
    					)
    				)
    			);//end sprintf
        echo apply_filters( 'tc_page_footer', $html );
    	return;
    }
    Thread Starter tonyx4x44

    (@tonyx4x44)

    works! thanks Menaka! Reliable as always

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Author box on pages’ is closed to new replies.