Site logo

Archived topic

How to disable author link on Trade Theme in GeneratePress

3 replies · Started by Ali on June 20, 2019

Viewing posts 1–4 of 4

Good day

i have been using the following code to disable the author and date link in GP theme. But, unfortunately, this code is not working on Trade theme (theme library). The date link is disabled but the author link is still clickable. How to disable that?

Check the below link for reference. TrackerZone is clickable. i want to disable it.

https://trackerzone.pk/car-security-challenges-in-karachi/

i have been using this code for GP theme and it works perfect (only GP theme)

add_filter( 'generate_post_date_output','tu_remove_date_link', 10, 2 );
function tu_remove_date_link( $output, $time_string ) {
printf( '<span class="posted-on">%s</span>',
$time_string
);
}
add_filter( 'generate_post_author_output','tu_no_author_link' );
function tu_no_author_link() {
printf( ' <span class="byline">%1$s</span>',
sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%1$s <span class="fn n author-name" itemprop="name">%4$s</span></span>',
__( 'by','generatepress'),
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() )
)
);
}

Please guide.

Thank you

Hi there,

that could doesn't apply ( obviously :) ) to the template tags in the Page Hero.
Simplest way is to stop pointer events on the a tags in the hero with this CSS:

.page-hero a {
    pointer-events: none;
}

Will that do the job?

Hello David. It worked. ;)

A bundle of thanks

You're welcome

This archived topic is closed to new replies.