- This topic has 21 replies, 2 voices, and was last updated 3 years, 1 month ago by Leo.
-
AuthorPosts
-
February 23, 2021 at 5:39 pm #1669984George
Is there a way to achieve that without using a header element? I don’t have great control over the title paddings using the header element (I also use a custom width for the single post page) plus I don’t want to lose the customizations I did on the meta.
February 23, 2021 at 5:41 pm #1669986LeoStaffCustomer SupportHi George,
Would this help?
https://generatepress.com/forums/topic/move-entry-header-above-content-and-sidebar/#post-684692February 23, 2021 at 5:53 pm #1669993GeorgeYeah, I’ve tried that, all it does is duplicates the title but doesn’t take it out of the container. And I also have the post meta.
February 23, 2021 at 6:12 pm #1670004LeoStaffCustomer SupportDoes this one work better?
https://wordpress.org/support/topic/title-above-content-and-sidebar/#post-13540076It would be much easier with GPP 2.0 😉
February 23, 2021 at 6:18 pm #1670008GeorgeOk, that worked exactly like the header element. I would have to adjust the width with CSS. But what about the post meta underneath?
I am using this example for the meta:
https://docs.generatepress.com/article/entry-meta-style/#example-2February 23, 2021 at 6:23 pm #1670012LeoStaffCustomer SupportDoes it work if you replace
generate_after_entry_title
withgenerate_after_header
in the entry meta code?Just switching a hook.
February 23, 2021 at 6:29 pm #1670016Georgegenerate_after_header
is the one used.generate_after_entry_title
just swaps meta and title position but keeps it inside the container.February 23, 2021 at 6:32 pm #1670018GeorgeOh, you mean the post meta hook maybe? Switching the hook puts the meta over the title and loses the styling.
February 23, 2021 at 6:34 pm #1670019LeoStaffCustomer SupportI just tried this function:
add_action( 'wp', function() { if ( is_page() || is_single() ) { add_filter( 'generate_show_title', '__return_false' ); } } ); add_action( 'generate_after_header', function() { if ( is_page() || is_single() ) : ?> <div class="header-entry-title grid-container grid-parent"> <h1 class="entry-title"><?php the_title(); ?></h1> </div> <div class="grid-container grid-parent entry-meta"> <?php generate_posted_on(); ?> </div> <?php endif; } ); add_filter( 'generate_header_entry_meta_items', '__return_empty_array' ); add_action( 'generate_after_header', function() { $header_post_types = apply_filters( 'generate_entry_meta_post_types', array( 'post', ) ); if ( ! in_array( get_post_type(), $header_post_types ) ) { return; } ?> <div class="entry-meta entry-meta-container grid-container"> <div class="entry-meta-gravatar"> <?php echo get_avatar( get_the_author_meta( 'ID' ) ); ?> </div> <div class="entry-meta-info"> <div class="entry-meta-author"> <?php generate_do_post_meta_item( 'author' ); ?> in <?php generate_do_post_meta_item( 'categories' ); ?> </div> <div class="entry-meta-date"> <?php generate_do_post_meta_item( 'date' ); ?> </div> </div> </div> <?php } );
And this is the result:
https://www.screencast.com/t/VShYxXqJSHLooks like it’s just missing the CSS styling.
If this still doesn’t work, any chance we can revisit the issue once GP 2.0 is live?
We really can’t be providing a custom/outdated solution like this at this point.
Thanks for your understanding.
February 23, 2021 at 6:37 pm #1670024GeorgeOk, better, it lost the author gravatar (displays default one) and author name, though.
February 23, 2021 at 6:41 pm #1670026GeorgeOk, sure. This is not outdated solution, though, this is how GP is right now! GP 2.0 is still alpha.
February 23, 2021 at 6:41 pm #1670027LeoStaffCustomer Supportit lost the author gravatar (displays default one) and author name, though
Not sure if I understand. Is this the result you are getting?
https://www.screencast.com/t/VShYxXqJSHCould we please revisit this issue once we can use the GP 2.0? We put in a lot of work for the dynamic content to avoid providing custom solution like this.
Thanks for your understanding.
February 23, 2021 at 6:58 pm #1670035GeorgeI have to say, it’s the only time I am not happy with support. I understand what you are saying but I think you should have provided support for existing features. The upcoming version is still alpha. I have a client handover in two days.
You know how much I respect you and all the GP crew but in this instance, I think it was wrong to refuse support like this. I hope you take it as constructive feedback.
February 23, 2021 at 7:05 pm #1670039LeoStaffCustomer SupportSo what isn’t working for you?
I added my code above with the CSS from the example doc page and this is the result:
https://www.screencast.com/t/z1rORY4YMIPIs this not what you are getting?
February 24, 2021 at 4:09 am #1670413GeorgeI am adding the same code as you do but I get the result attached. Basically, I lose the normal avatar image (default icon is displayed) and the Author name.
-
AuthorPosts
- You must be logged in to reply to this topic.