[Resolved] Display Author meta in Header and problem with elementor

Home Forums Support Display Author meta in Header and problem with elementor

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #931171
    Huy

    Hi guys

    I have a problem in displaying author meta in Header Element

    I used your code in another topic to create shortcode, I adjusted it a little bit

    function tu_custom_author_meta() {
      ob_start();
      global $post;
      $author_id = $post->post_author;
      ?>
    	<header class="page-header">
    	  <div class="author-meta">
    	  	  <h1 class="page-title"><?php echo get_the_author_meta( 'nickname', $author_id ); ?></h1>
    	  	<div class="author-photo"> <?php echo get_avatar( $author_id ); ?></div>
    	  	<p class="author-description"><?php echo get_the_author_meta( 'description', $author_id ); ?></p>
    	  </div>
    	</header>
      <?php
      return ob_get_clean();
    }
    add_shortcode( 'author_meta','tu_custom_author_meta' );

    Then I added shortcode [author_meta] in Header Element. It worked, and showed up like this: http://prntscr.com/o2i5wf

    However, because I use elementor to design author archive page, when the Header is active, it has an error like this: http://prntscr.com/o2i6e3. it shows only one post per page instead of 6 posts per page.

    If I disable the Header, it works like normal: http://prntscr.com/o2i6px.

    Could you please show me a way to fix this error, please

    #931209
    David
    Staff
    Customer Support

    Hi there,

    that is peculiar – not sure how the header element would effect their post loop query.
    But it looks like you’re also displaying the same meta data in Elementor – is there a need for the GP header?

    #931484
    Huy

    Yes I think

    Cause in Elementor it’s hard for me to customize the layout as I want.

    I also want to use Header for all of my archive pages so I really like using Header Element

    #931693
    Tom
    Lead Developer
    Lead Developer

    Is the issue viewable right now? The site looks good to me.

    Let me know πŸ™‚

    #932083
    Huy

    Yeah I changed totally to use Elementor and disable Page Header so it looks good now

    Thank you

    #932491
    Tom
    Lead Developer
    Lead Developer
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.