badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

How do remove author and date links from the posts and widgets?

Tagged: ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #80943
    alex.casinov777
    Participant

    Greetings!

    I want to delete URLs for Author and Date, but still, keep them visible. For example, at the moment I have this:

    September 7, 2020 Alex Konst No Comments

    Both data (Author name and date) are clickable. Yoast SEO can only remove these features, but I want to keep them, and just remove links, because at the moment, from my post there are 30+ outbound links (2 from the post breadcrumbs, 20 in a right sidebar, 10 in the footer).

    Can you help me with that?

    #80990

    Hi alex.casinov777,

    To make the Date and Author not clickable then Please go to ‘Appearance > Customize > Additional CSS’ and paste the below Custom CSS code.

    .entry-meta .author a,
    .entry-meta .date a {
    	pointer-events: none;
    	cursor: default;
    }

    Thanks

    #81007
    alex.casinov777
    Participant

    Thanks, but it doesn’t solve the problem. It’s just hides the visual ability to click on links. Still, in the code part exist. I need to remove the links

    #81008
    alex.casinov777
    Participant

    for example

    <div class="by-author vcard author"><a href="#">Matthew Gill</a> </div>
    <a href="#">Matthew Gill</a>
    <div class="by-author vcard author"><a href="#">Matthew Gill</a> </div>
    #81060

    Ok if you want to remove the code as well then you have to remove the link from the code of every sections and widgets. As you know the code to remove the link but we recommend you to customize the after making the child theme so that you wont loose the customized code when updating the Theme to a newer Version in future.

    Thanks

    #81062
    alex.casinov777
    Participant

    The problem is that I cant find a file that holds all data for the links :C can you help me where to dig?

    #81119

    Go to theme directory > inc > function.php. On line no: 142 to 144, you will find the below line of codes.

    $posted_on = '<a href="' . esc_url( get_permalink() ) . '" title="'. the_title_attribute('echo=0') . '">' . esc_html( $time_string ) . '</a> ';
    
    		$byline = '<a href="' . esc_url( get_author_posts_url( get_the_author_meta('ID') ) ) . '">' . esc_html( get_the_author() ) . '</a> ';

    Now replace the above code with the code provided below.

    $posted_on = '<a href="#" title="'. the_title_attribute('echo=0') . '">' . esc_html( $time_string ) . '</a> ';
    
    		$byline = '<a href="#">' . esc_html( get_the_author() ) . '</a> ';

    Thanks

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.