-
AuthorPosts
-
March 15, 2017 at 3:18 pm #761445
Hi,
I have a site that is several years old with older post content that displays last published date on my Blogs and the same date is used in Google SERP.
1) I would like to keep the original Post date on my website post page. (so when I open up archive files it will show up in the month that post was published)
2) I would like to replace Publish date with text ‘last Updated-” and Modified date to my website post page
3) I would like the replace Publish date with text “last update-” and Modified date to be used in the Google SERP.I found a plugin (WP Last Modified) that will do #2 & #3, but the plugin is 2 yrs old and not support
however, I have activated the plugin to do #2 only, and the results look like thisI have not enabled the plug in to do #3
I would like to add some code to my site to accomplish 1,2,3 and deactivate plugin.
I have also found an article
http://www.wpbeginner.com/opinion/why-you-should-not-remove-dates-from-your-wordpress-blog-posts/that suggests adding the code below to Post Meta Data. I am not sure where this is located or if this code is correct.
Last updated on <time datetime=”<?php the_modified_time(‘Y-m-d’); ?>”><?php the_modified_time(‘F jS, Y’); ?></time>Do you have an advice on how to accomplish adding Last Modified Date to Post and SERP.
thanks
March 17, 2017 at 1:46 pm #762481added tag to allow for search on my service request.
March 19, 2017 at 11:22 am #763171Hi EdFritz,
Do you still need our help with this issue? I see you have the date and last modified already there.
You might want to make font smaller (for the “last update”), since more for Google and not your visitors.Let us know if you have any more questions.
Best regards,
VictoriaMarch 19, 2017 at 3:46 pm #763213Hello,
Yes I still need support.
As my support tix says, I am using a plugin that has deprecated and is not longer supported. I want to deactivate this plugin, but for the moment it is the only way I can get a Modified on date on blogs.
Secondly, I want to know how to use the Date Modified to my Google Serp and not the Date Posted. A google search on one of my ranking post shows a post date in 2014.
Thanks for reaching out and I look forward to getting started with your idea.
Ed Fritz
March 21, 2017 at 5:03 pm #764258Hi Ed Fritz,
Here is a fresh article on how to add date modified to your posts.
And here is a good example for Google SERP time modified:
http://webmasters.stackexchange.com/a/79401Let us know if you have any more questions and hope this was helpful.
Best regards,
VictoriaMarch 21, 2017 at 7:12 pm #764311Hello Victoria,
I saw those article in my prior search before opening up this support tix.
Let’s work on Modified date on Blog first.
Please tell me where the enfold theme template tags is located. I could not find it when I looked before. I will need the code responsible for displaying the date and time.
Method 2: Add Last Updated Date in Theme Templates
This method requires you to edit specific WordPress theme files. Many WordPress themes now use their own template tags which define how these themes show post meta data like date and time.
Some themes also use content templates or template parts to display posts.
Few simpler themes will use single.php, archive.php, and other template files to show content and meta information.
You will be looking for the code responsible for displaying the date and time. You can then either replace that code with the following code, or add it right after your theme’s date and time code.
1
$u_time = get_the_time(‘U’);
2
$u_modified_time = get_the_modified_time(‘U’);
3
if ($u_modified_time >= $u_time + 86400) {
4
echo “<p>Last modified on “;
5
the_modified_time(‘F jS, Y’);
6
echo ” at “;
7
the_modified_time();
8
echo “</p> “; }thanks
Ed
March 24, 2017 at 1:37 pm #766141Hi EdFritz,
Yes single.php, archive.php, include/loop-index.php, and include/loop-page.php are the templates you should look into, depending on where you want to show date modified.
Let us know if you have any more questions.
Best regards,
VictoriaMarch 24, 2017 at 2:32 pm #766199Hello, I need a little more detail and more help. I’d ask that you look at my question and answer it specifically. I asked:
Please tell me where the enfold theme template tags is located. I could not find it when I looked before. I will need the code responsible for displaying the date and time.
So I have enclosed the enfold single.php……. where is the date and time displayed in the code ???
This is the enfold single PHP where exactly is the date and time displayed in the code.
<?php
if ( !defined(‘ABSPATH’) ){ die(); }global $avia_config;
/*
* get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
*/
get_header();$title = __(‘Blog – Latest News’, ‘avia_framework’); //default blog title
$t_link = home_url(‘/’);
$t_sub = “”;if(avia_get_option(‘frontpage’) && $new = avia_get_option(‘blogpage’))
{
$title = get_the_title($new); //if the blog is attached to a page use this title
$t_link = get_permalink($new);
$t_sub = avia_post_meta($new, ‘subtitle’);
}if( get_post_meta(get_the_ID(), ‘header’, true) != ‘no’) echo avia_title(array(‘heading’=>’strong’, ‘title’ => $title, ‘link’ => $t_link, ‘subtitle’ => $t_sub));
do_action( ‘ava_after_main_title’ );
?>
<div class=’container_wrap container_wrap_first main_color <?php avia_layout_class( ‘main’ ); ?>’>
<div class=’container template-blog template-single-blog ‘>
<main class=’content units <?php avia_layout_class( ‘content’ ); ?> <?php echo avia_blog_class_string(); ?>’ <?php avia_markup_helper(array(‘context’ => ‘content’,’post_type’=>’post’));?>>
<?php
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*
*/get_template_part( ‘includes/loop’, ‘index’ );
//show related posts based on tags if there are any
get_template_part( ‘includes/related-posts’);//wordpress function that loads the comments template “comments.php”
comments_template();?>
<!–end content–>
</main><?php
$avia_config[‘currently_viewing’] = “blog”;
//get the sidebar
get_sidebar();?>
</div><!–end container–>
</div><!– close default .container_wrap element –>
<?php get_footer(); ?>
March 26, 2017 at 2:16 pm #766937Hi Enfold support,
It has been 11 days since my support request and I am no closer to having any resolution on my simple request.
The request is important to me and I would assume to other users who have evergreen content.
I was advised by SEO consultant that ‘Modern’ themes have capabilities built in to enable ‘Last Modified” dates.
Can support please advise:
I need the code responsible for displaying the date and time.
I was advised by support to look into the enfold single.php……. where is the date and time displayed in the code ???thanks,
Ed
March 26, 2017 at 4:36 pm #766971Hi EdFritz,
Single.php calls another template – get_template_part( ‘includes/loop’, ‘index’ ), which is includes/loop-index.php, there you can find date and time and fix it there.
Best regards,
Victoria- This reply was modified 7 years, 9 months ago by Victoria.
March 28, 2017 at 5:48 am #767866Hi Victoria, thanks for the reply and info. I’ll have a go at this after my travels next week. thanks again
March 28, 2017 at 6:22 am #767874Hi,
Let us know if you have any other questions or issues :)
Best regards,
John Torvik -
AuthorPosts
- You must be logged in to reply to this topic.