Hi,
I am trying to remove the data from articles written by a certain author
In the page single_template_2.php i have modified the code so:
<div class=”td-module-meta-info”>
<?php echo $td_mod_single->get_author();?>
<?php if ($post->post_author != ’88’) {
echo $td_mod_single->get_date(false);}?>
<?php //echo $td_mod_single->get_views();?>
<?php echo $td_mod_single->get_comments();?>
It seems to work, removing the dates from the author with the id=88.
(Only problem remains the hyphen after the author’s name … how to kill?)
Now, to not show the date in google search, I think you should also hide
<meta property=”article:published_time
<meta property=”article:modified_time”
and
<meta itemprop=”datePublished”
<meta itemprop=”dateModified”
How can I do to eliminate them, again just for the author with id = 88?
Thanks!
Hi,
In order to remove the hyphen after the author name, you have to access the file where the get_author function is being created: http://screencast.com/t/AiMBfOuyPO
As for the meta info, you can fiond it in this file: http://screencast.com/t/aPtLW0u64 – As you can see there is a condition to not show it on pages, so you can try to add another condition for the author as you did above.
Hope this helps.
Thank you!
Hi Bogdan,
I try your solution for Remove date e hyphen in post written by a certain author
I modified the one in bold but they do not work, maybe something wrong
for hide date on meta for author 88
// don’t display meta on pages
if (!is_single() and ($post->post_author != ’88’)) {
return ”;
}
and for hide hyphen for author 88
if (td_util::get_option(‘tds_p_show_author_name’) != ‘hide’ and td_util::get_option(‘tds_p_show_date’) != ‘hide’ and ($post->post_author != ’88’) != ‘hide’) {
$buffy .= ‘ – ‘;
}
$buffy .= ‘</div>’;
}
return $buffy;
}
Thanks
Hi,
even with your suggestion removes the hyphen and the destination also for the other authors …
on the other hand does not take off
<Meta property = “article: modified date”
<Meta property = “og: updated_time”
and even
<Meta itemprop = “datePublished”
<Meta itemprop = “DateModified”
Any suggestion?
Perhaps it may be easier to delete all displayed dates and meta only for older posts, for example those older than one year? In this case, how could I do?
Thanks!
Hi,
I tried fiddling with this a bit more and found this to work.
if (td_util::get_option('tds_p_show_author_name') != 'hide' and $this->post->post_author !=88 ) { in order to remove a specific author
and for the meta info try it like so: http://screencast.com/t/ruDMIjan
This worked on my end.
Thank you!
Thanks Bogdan,
so work perfectly, though to remove the meta from author id=88
in the function below I had to put the id of the authors (1 and 2) I wanted the meta
// Do not meta the display on pages
if (! is_single ()) {
return ”;
}
if ($ this-> post> post_author! = 1 and $ this-> post> post_author! = 2) {
return ”;
}
Instead with regard to eliminating the dates from the oldest post,
such as published for more than a year, you have any suggestions for me?
What function I could use?
Thanks again
Hi
You’ll need a custom function which convert published post date to unix format then compare the result with a value which will also be unix format. Basically you’ll need a variable which store the published date for current post and another variable which store the date to compare. Here you can find some useful information in this regard: http://php.net/manual/en/datetime.settimestamp.php
This is a complex task which require many customizations and tests in order to be achieved.
We can’t offer customization services at the moment so if you still need guidance on this or you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you.
Thanks for your understanding!