- This topic has 7 replies, 3 voices, and was last updated 4 years ago by
David.
-
AuthorPosts
-
March 4, 2019 at 9:26 pm #829033
Kevin Wabiszewski
Hello, is there a way to make the author’s name and the date on posts not clickable?
Thanks again for your help.
GeneratePress 2.2.2GP Premium 1.7.8March 4, 2019 at 9:29 pm #829035Leo
StaffCustomer SupportHi there,
See the last examples in these links:
https://docs.generatepress.com/article/generate_post_author_output/
https://docs.generatepress.com/article/generate_post_date_output/Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know if this helps 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 4, 2019 at 10:26 pm #829062Kevin Wabiszewski
Hi Leo, if this is too much to ask don’t worry about it. I know this doesn’t really fall into the scope of support but I tried adding that code and it did add the unclickable author name and date, but there were 2 of them since I am currently using this code. I think some of the fields as slightly different.
add_filter( ‘generate_post_author’, ‘__return_false’ );
add_filter( ‘generate_post_date_output’, function( $date ) {
printf(
‘<span class=”meta-gravatar”>%s</span>’,
get_avatar( get_the_author_meta( ‘ID’ ) )
);echo ‘<span class=”meta-data”>’;
printf( ‘ <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() )
)
);echo $date;
echo ‘</span>’;
} );March 5, 2019 at 4:43 am #829300David
StaffCustomer SupportHi there,
you can disable the pointer events using this CSS:
.byline .author a { pointer-events: none; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 5, 2019 at 11:27 am #829807Kevin Wabiszewski
Thanks guys!
March 5, 2019 at 11:29 am #829814David
StaffCustomer SupportYou’re welcome – glad we could be of help
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 5, 2019 at 11:32 am #829825Kevin Wabiszewski
Then just
.posted-on a {
pointer-events: none;
}To disable the date link right?
March 5, 2019 at 11:35 am #829829David
StaffCustomer Supportthats correct
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.