Author box, Article top AD

Posted in: Newspaper
Post count: 22

Hello,

There is any way to remove the urls(from: author name and gravatar image) to the author page in the author box?I want to see only the author name without the hyperlink.

Your Article Top AD spot is awesome but the biggest problem with it, if you are using adsense its againts their TOS to show it on 404pages, log off pages, etc.. and sadly the theme put it everywhere without filtering.
How can i show the ad only on the home, category, post pages ?

Thanks in advance.

Post count: 6600

Hi,

I believe you are refereeing to this URL http://screencast.com/t/UHUSRsis If so you can remove it like this http://screencast.com/t/KWZP2SaIyJE or if you want to just hide it use this custom css in theme panel > custom css:

.td-author-url {
display: none;
}

Regarding the ad, I believe you are referring to the “Header AD Box” because the “Article top ad” it’s displaying only on single post pages.
A way would be to hide via css on those pages where you don’t want it, or if you have basic programming skills you can create a condition to determine if it’s one of the pages you want the add to show on then render the ad spot.

Thanks

Post count: 22

I mean this: http://snag.gy/Htkj0.jpg . I want to remove both url. I want to see the author name and an image without linking to the author page.

Yes sorry, i mean the “Header AD Box”. I thought there is any other way. This code gonna work?
<?php if ( is_home() || is_single() || is_category() ) : ?>

Post count: 388

In Newspaper/includes/modules/module_modifier/ you have td_module_blog.php. This is one of the files you can overwrite (at least I find) in a child theme, which you can set up here: https://forum.tagdiv.com/child-theme-documentation/

Once you have the child theme set up and activated, copy and paste that file into the corresponding folder in your child theme. Then edit the file.

The function get_author_box is the one you want to change.

Specifically, change these lines:


$buffy .= '<a href="' . get_author_posts_url($author_id) . '">' ;
$buffy .= get_avatar(get_the_author_meta('email', $author_id), '106');
$buffy .= '</a>';

to this one line:

$buffy .= get_avatar(get_the_author_meta('email', $author_id), '106');

and change this line:


$buffy .= '<a href="' . get_author_posts_url($author_id) . '">' . get_the_author_meta('display_name', $author_id) . '</a>' ;

to this:

$buffy .= get_the_author_meta('display_name', $author_id);

Save the file and upload via FTP. Clear cache and check the bottom of a post.

Hope this helps!

Post count: 22

Thanks, working like charm!

Post count: 388

Welcome 🙂

Now that you have a child theme going you can edit the ad boxes too, in some file or other, but I haven’t looked at that myself, and @Lucian could probably cut down the time looking for where to add the conditions.

Post count: 3343

Thanks, @TheMediumUTM for your help!

Have a nice day! 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.