- This topic has 6 replies, 3 voices, and was last updated 6 years, 10 months ago by skynet.
-
AuthorPosts
-
November 7, 2017 at 5:03 pm #125677skynetParticipant
Hello great Catchthemes team i want to insert the last update date of posts on my blog and i follow the first method here http://devotepress.com/tutorials-hacks/display-last-updated-date-wordpress/
when i add this code (as described on devotepress) on my functions.php i get error 500 on my blog, simply this code broke the blog with catchbox pro 4.9.3 i get blog back with backup of functions.phpis there any method to put this option on catchbox pro and make it working in the next theme version? Maybe an option to add or remove “last updated post”. I think its a great idea for all users to see updated post expecially when you have so much readers and you update article 2 times a month like me. It is difficult to keep track of updated articles and having this option to show you when you have modified an article the last time would make blogging so much easier.
November 7, 2017 at 5:05 pm #125678skynetParticipantPS: when i try to add the code on the forum “here” “Method 1: Display Last Updated Date before Post Content” http://devotepress.com/tutorials-hacks/display-last-updated-date-wordpress/
and try to post it i get blocked here in the forum, maybe something is wrong with the code or some forum protection? https://www.dropbox.com/s/6q4x3eltaouhykf/Screenshot%202017-11-08%2000.01.25.png?dl=0November 8, 2017 at 1:39 am #125697tikaramParticipant@skynet : Download catch box pro child theme from the following link and add the following code to the functions.php file of your child theme.
function wpb_last_updated_date( $content ) { $custom_content = ''; $u_time = get_the_time('U'); $u_modified_time = get_the_modified_time('U'); if ($u_modified_time >=$u_time + 86400) { $updated_date = get_the_modified_time('F jS, Y'); $updated_time = get_the_modified_time('h:i a'); $custom_content .= '<p class="last-updated">Last updated on '. $updated_date . ' at '. $updated_time .' '.'</p>'; } $custom_content .= $content; return $custom_content; } add_filter( 'the_content', 'wpb_last_updated_date' );
Let me know if you have any further issues.
Regards,
TikaramNovember 8, 2017 at 9:23 am #125713skynetParticipantHello tikaram, i have to upload this file where? on FTP –> wp-content –> themes?
PS: If i don’t want to use child theme, is there any way to add this option to “on/off” button in the future catchbox pro update? It would be a great for all users i dont know if easy to implement or no.
November 8, 2017 at 12:04 pm #125735skynetParticipantUpdate: i installed child theme and activated it and broke all my blog with standard catchbox pro functions and layout. So i think best idea is to wait an option for this feature maybe in the future.
November 8, 2017 at 1:35 pm #125743November 8, 2017 at 1:49 pm #125745skynetParticipantThank you so much @Sakin 🙂
-
AuthorPosts
- The topic ‘Last update date of posts + Suggestion’ is closed to new replies.