WordPress.org

Ready to get started?Download WordPress

Forums

Testimonial Rotator
[resolved] Show Author Info For Archive Page (2 posts)

  1. purplebabyhippo
    Member
    Posted 2 months ago #

    I love this plugin, it is so simple and yet can can do so much.

    I am displaying all my testimonials on a page "testimonials" as a list by using the shortcode [testimonial_rotator id=1020 format=list]
    I am displaying the full content by placing code in my functions.php : if( 'testimonial' == get_post_type() ) {
    return 'full-width-content';

    but I want to also display the author information as per the single posts.
    How can I do this?
    What is the meta-box value for this field?

    https://wordpress.org/plugins/testimonial-rotator/

  2. purplebabyhippo
    Member
    Posted 2 months ago #

    I have worked out how to do this by adding the following to my functions.php (I'm using the Genesis Framework)

    add_action( 'genesis_before_loop', 'pbh_full_content_testimonials' );
    
    function pbh_full_content_testimonials() {
      if (is_post_type_archive('testimonial') ) {
    		remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
    		add_action( 'genesis_entry_content', 'pbh_do_post_content' );
    }
    
    }
    function pbh_do_post_content() {
    	the_content();
    
    global $post;
    
    $cite 				= get_post_meta( get_the_ID(), '_cite', true );
    
    	echo "<div class=\"testimonial_rotator_author_info cf-tr\">\n";
    	echo wpautop($cite);
    	echo "</div>\n";
    }

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

Reply

You must log in to post.

About this Plugin

About this Topic