Assigning Two Different Post Dates For Single Post

Have you tried the basic Custom Fields that WordPress includes automatically? If you don’t see it at the bottom of your Post edit screen, click the Screen Options button at the top-right of your editor window and check the box next to Custom Fields to make it visible. Once you can see it at the …

Read more

How to remove a link of date archive

I don’t know which theme your are using, I am explaining you same thing for twenty seventeen theme, go to wp-content\themes\twentyseventeen\inc\template-tags.php, You will find function twentyseventeen_time_link() there. In this function you will get code as like return sprintf( /* translators: %s: post date */ __( ‘<span class=”screen-reader-text”>Posted on</span> %s’, ‘twentyseventeen’ ), ‘<a href=”‘ . esc_url( …

Read more

How to update all posts at once?

I think you want to mass change old URLs in website database after migration. You can do it either by using plugin or manually. Plugin Method: The Velvet Blues Update URLs plugin enables you to change the URLs at various places, like posts and pages excerpts. Follow these steps: Install and activate Velvet Blues Update …

Read more

How to add publish date in the title

if the output you see is ABC [post_published], then it means your shortcode isn’t working as it should. try including following code at the end of inside your theme’s functions.php file. function ppd_shortcode(){ return get_the_date(); } add_shortcode(‘ppdate’, ‘ppd_shortcode’); When you register a shortcode using the add_shortcode function, you pass in the shortcode tag ($tag) and …

Read more

Display time difference (6 hours ago) in a Soliloquy caption

In your filter function you should pass post ID to get_the_time() function, otherwise you will get the date from current post. function wpse_relative_date( $date, $format, $post ) { return human_time_diff( get_the_time(‘U’, $post), current_time( ‘timestamp’ ) ) . ‘ ago’; } add_filter( ‘get_the_date’, ‘wpse_relative_date’, 15, 3 ); References: get_the_time() function get_the_date filter

I am trying to get cutom post cout by month of current taxonmy term

you can do that with WordPress functions like that : $post_type = “tesekkur”; $timestamp_start = strtotime(“first day of next month -1 year midnight”); $start = date(“Y-m-d H:i:s”, $timestamp_start); $posts = get_posts([ “nopaging” => TRUE, “post_type” => $post_type, “date_query” => [ “after” => $start, ], ]); // sort by month $tab = []; foreach ($posts as …

Read more

How display modified date of most recent modified post in wordpress?

This works for me. Place this in your functions.php file: function prefix_last_modified_date() { $last_modified_date = null; $args = array( ‘post_type’ => ‘post’, // could be page, or a CPT ‘orderby’ => ‘modified’, ‘post_count’ => 1, ); $last_modified = new WP_Query( $args ); if ( $last_modified->have_posts() ) { $last_modified->the_post(); $last_modified_date = get_the_modified_date(); } wp_reset_postdata(); return $last_modified_date; …

Read more