Getting an Error in GeneratePress Theme
-
When I audit my website in Woorank, I am getting a tap target error, I have also attached the screenshot. Please help me to fix this problem.
Website Url: https://www.wikihelp.in/
Please refer to this link:https://www.woorank.com/en/www/wikihelp.in

The page I need help with: [log in to see the link]
-
Hi there,
those are the Author Links in your Post Meta. You could try adding some padding to the link when on smaller devices to increase the target size like so:
@media (max-width: 420px) { .entry-meta .byline a { display: inline-block; padding: 10px 0; } }You Are Amazing David, I Love Your Support. You Solved My Problem, I am Very Happy, Thank You Very Much. God Bless You @diggeddy
A pleasure to be of help. And thank you for the kind words.
You can try this which will force the byline to a whole new line:
@media (max-width: 420px) { .entry-meta .byline { display: block; padding: 10px 0; } }Other then that there isn’t much else to be done.
What doesn’t look good?
Can you specify what you’d like to see/change?
Hey David, I want to know that how can I show the Post Meta Data with Gravatar in GeneratePress Theme like this:

-
This reply was modified 6 years, 6 months ago by
Shivam Pandey.
-
This reply was modified 6 years, 6 months ago by
Shivam Pandey.
Take a look at this page:
https://docs.generatepress.com/article/entry-meta-style/I checked the documentation and I like the “Example 1” post meta style. But I have doubt where I will add below PHP code.
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">%4$s<a href="%1$s" title="%2$s" rel="author"><span class="author-name" itemprop="name">%3$s</span></a></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() ), get_avatar( get_the_author_meta( 'ID' ) ) ) ); } ); add_filter( 'generate_header_entry_meta_items', function() { return array( 'author', 'comments-link', 'date', ); } ); add_filter( 'generate_footer_entry_meta_items', function( $items ) { return array( 'date', 'categories', ); } );-
This reply was modified 6 years, 6 months ago by
Shivam Pandey.
Is the above code a custom function? If yes, how can I add this code through File Manager (cPanel)? I don’t want to use any plugin.
what happens when I update the theme? Theme containing this function or overwritten by a new one.This article explains how to add PHP to your site:
https://docs.generatepress.com/article/adding-php/
Info on child theme:
https://docs.generatepress.com/article/using-child-theme/
The Code Snippets plugin is the alternative. It adds no overhead to the front end and is the easiest way to go.
Hello David,
I asked you that the code given below is a custom function or not?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">%4$s<a href="%1$s" title="%2$s" rel="author"><span class="author-name" itemprop="name">%3$s</span></a></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() ), get_avatar( get_the_author_meta( 'ID' ) ) ) ); } ); add_filter( 'generate_header_entry_meta_items', function() { return array( 'author', 'comments-link', 'date', ); } ); add_filter( 'generate_footer_entry_meta_items', function( $items ) { return array( 'date', 'categories', ); } );Yes, it is a custom function and the code is PHP – the articles provided explain the secure way of adding them to the theme.
Thank you for clarification David, What happens when I update the theme? Theme containing this custom function or overwritten?
-
This reply was modified 6 years, 6 months ago by
The topic ‘Getting an Error in GeneratePress Theme’ is closed to new replies.


