- This topic has 5 replies, 3 voices, and was last updated 1 year, 7 months ago by
Tom.
-
AuthorPosts
-
June 16, 2019 at 4:06 am #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
June 16, 2019 at 5:36 am #931209David
StaffCustomer SupportHi 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?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 16, 2019 at 9:12 am #931484Huy
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
June 16, 2019 at 3:50 pm #931693Tom
Lead DeveloperLead DeveloperIs the issue viewable right now? The site looks good to me.
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJune 17, 2019 at 3:59 am #932083Huy
Yeah I changed totally to use Elementor and disable Page Header so it looks good now
Thank you
June 17, 2019 at 9:02 am #932491Tom
Lead DeveloperLead DeveloperAwesome π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.