eliminate the date on some posts or pages

Latest Reply from Migun at 2014-06-18 04:13:57 Solution
how can I remove the dates on some posts or pages?
and what difference there between the standard version and the developer?
thanks!
Hi!
To get rid of this data you have to remove the highlighted code:
<span class='post-date'><?php echo get_the_date(); ?></span>

from the file theloop.php.
The only difference is the links in the footer. To remove them you have to purchase the theme.

but so will remove the date on each post!?
I want to remove only on certain pages!
I can do it?
thanks for your help
Hi!
To fix this you have to replace the code:
<span class='post-date'><?php echo get_the_date(); } ?></span> 

with:
<?php if (in_array( $post->ID, array('YourPostID', 'YourPostID'))) {  ?><span class='post-date'><?php echo get_the_date(); } ?></span>  

in the file theloop.php.
In this case the post "YourPostID" will be displayed without the date.
I did not understand, on what line I insert the code?


</div>
<div class='post-body'>
<span class='post-date'>
<div class='day'><?php echo get_the_date('d'); ?></div><br />
<div class='month'><?php echo get_the_date('M'); ?></div><br />
<div class='year'><?php echo get_the_date('Y'); ?></div>
</span>
Then you need to replace the code:
<span class='post-date'>
<div class='day'><?php echo get_the_date('d'); ?></div><br />
<div class='month'><?php echo get_the_date('M'); ?></div><br />
<div class='year'><?php echo get_the_date('Y'); ?></div>
</span>
with:
<?php if (in_array( $post->ID, array('YourPostID', 'YourPostID'))) {  ?><span class='post-date'>
<div class='day'><?php echo get_the_date('d'); ?></div><br />
<div class='month'><?php echo get_the_date('M'); ?></div><br />
<div class='year'><?php echo get_the_date('Y'); ?></div>
</span><?php }?>
ok thanks alice you were very kind

Leave a reply

Add codeAdd image