- This topic has 21 replies, 3 voices, and was last updated 3 years, 7 months ago by
Fernando.
-
AuthorPosts
-
August 25, 2022 at 3:48 am #2323324
David
StaffCustomer SupportPlease raise a separate topic for each unrelated issue. This will allow us to focus on one requests at a time.
Back to the Navigation.You can social icons and other buttons in the navigation by:
1. Create a new Block Element in Appearance > Elements.
2. Set the Hook to:menu_bar_items
3. Add whatever blocks or other content you require to the element editor.
4. Any block you want to hide on different devices, select the block and in Advanced > Additional CSS Classs(es) add one of the GPhide-on-*classes:https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classes
August 26, 2022 at 12:20 am #2324237Ravi Saive
Thanks David.
One last query, I can’t see “Display comment count” on a single post here – https://i.postimg.cc/prjTXhK4/comment.png
August 26, 2022 at 12:50 am #2324258Fernando Customer Support
There’s no such option in the customizer for Single. It’s only for Archives.
You can try adding this Snippet to add it on single posts:
add_action( 'wp', function() { if ( !is_admin() && is_single() ) { add_filter( 'generate_show_comments', '__return_true' ); } } ); add_filter( 'generate_header_entry_meta_items', function( $items ) { return array_diff( $items, array( 'comments-link' ) ); } );Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets
August 26, 2022 at 1:02 am #2324271Ravi Saive
Hi Fernando,
The given code is not working…
I am using the following code on the Live site GP version 2.4.2, which displays the tags properly…
/Meta Tags in one line add_filter( 'generate_post_author_output', function() { return sprintf( ' <span class="byline">%1$s</span>', sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author"><span class="author-name" itemprop="name">%3$s</span></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ), esc_html( get_the_author() ) ) ); } ); add_filter( 'generate_header_entry_meta_items', function() { return array( 'author', 'date', 'categories', 'comments-link', ); } ); add_filter( 'generate_footer_entry_meta_items', function( $items ) { return array_diff( $items, [ 'categories', 'comments-link' ] ); } );But the same code on the GP version 3.1.3 on staging site not working see – https://i.postimg.cc/prjTXhK4/comment.png
August 26, 2022 at 1:12 am #2324281Fernando Customer Support
Try adding this below that code:
add_action( 'wp', function() { if ( is_single() ) { add_filter( 'generate_show_comments', '__return_true' ); } } );August 26, 2022 at 2:01 am #2324325Ravi Saive
Thanks, Fernando, it works…:)
August 28, 2022 at 4:59 pm #2326636Fernando Customer Support
You’re welcome Ravi!
-
AuthorPosts
- You must be logged in to reply to this topic.