Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CARA 1:
- Langsung pastekan kode berikut di theme wp:
- <?php $u_time = get_the_time('U');
- $u_modified_time = get_the_modified_time('U');
- if ($u_modified_time >= $u_time + 86400) {
- echo "<p>Last modified on ";
- the_modified_time('F jS, Y');
- echo " at ";
- the_modified_time();
- echo "</p> "; } ?>
- Tampilanny:
- Last modified on October 9th, 2017 at 12:24
- CARA 2 >> Muncul Otomatis Sebelum Content:
- Paste di function.php:
- function wpb_last_updated_date( $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' );
- Paste di style.css:
- .last-updated {
- font-size: small;
- text-transform: uppercase;
- background-color: #fffdd4;
- }
Advertisement
Add Comment
Please, Sign In to add comment