How to display posts categori list by day wordpres
There is a better method using date_query property of WP_Query class: ‘date_query’ => array( ‘column’ => ‘post_date’, ‘after’ => ‘- 1 days’ )
There is a better method using date_query property of WP_Query class: ‘date_query’ => array( ‘column’ => ‘post_date’, ‘after’ => ‘- 1 days’ )
WooCommerce seems to update the ‘last modified’ value of a product on every change. If you want to take a look at the source code, go to woocommerce\includes\data-stores\class-wc-product-data-store-cpt.php and check the function update. This solution seems to work, however it could be improved to make sure it doesn’t mess up with anything else. Basically checks … Read more
You can probably do this by customizing the feed: https://codex.wordpress.org/Customizing_Feeds This way you can make your own template for a feed, and alter the pubDate to your needs.
You can achieve this by using following code: /* Automatically set the image Title, Alt-Text, Caption & Description upon upload ————————————————————————————–*/ add_action( ‘add_attachment’, ‘my_set_image_meta_upon_image_upload’ ); function my_set_image_meta_upon_image_upload( $post_ID ) { // Check if uploaded file is an image, else do nothing if ( wp_attachment_is_image( $post_ID ) ) { $custom_title = date(“Y-m-d”); //settings current date as … Read more
Firstly it’s great to clean up your database, and doing this may make some queries faster. Bear in mind that the size of the data in this case is small and these postmeta keys may not be often used so there is little value in removing them, especially if you find you need them late: … Read more
It depends on how this gets rendered in the theme you’re using. As you want to change things in one place to look different to the rest of the site, you’ll need to track down where that is and change the date format there. Finding where it is might be tricky but once you do … Read more
WordPress wrong dates bug
Here is the answer given by Ferman on wpfr.net function date_commentaire( ){ $comments = get_comments( array( ‘post_id’ => get_the_ID() )); if ( doing_action( ‘wp_ajax_get-comments’ ) ) foreach ( $comments as $comment ) : $a = $comment->comment_ID; $b = get_comment_ID(); $date_comment = get_comment_date(); $time_comment = get_comment_time(); if ( $a==$b ) echo ‘<p class=”commentaire-date”>’.’Commentaire N°: ‘.$comment->comment_ID.’ du: … Read more
for example use: _e(‘the things to print’) or if woocommerce is being used its possible to use this way: _e(‘the things to print’, ‘woocommerce’) add_filter( ‘get_the_date’, function($the_date, $d, $post){ $date = new DateTime( $post->post_date ); echo _e($date->format(‘j F, Y’)); // change formatting as needed }, 10, 3 ); for more information about _e() the text … Read more
You can set translation of date/time format from here while Polylang plugin was actived: dashboard menu -> Languages -> Strings translations for example: for date_format English translation: m/d/Y for date_format Chinese translation: Y年n月j日