My website is showing today’s date instead of published date since db migration to a new wordpress

I exported my database and content to a new WordPress. Everything works fine, except that every post is showing under today’s date, instead of the published date like it should be (the actual published date is the good one in the dashboard though).

It was working correctly in my last WordPress (5.0.11). The new one is 5.6.1. Here’s the PHP related to the date in my theme :

<span class="post-date">     <?php     $  date = date_i18n( get_option( 'date_format' ), strtotime( get_the_date( 'r' ) ) );     printf( esc_html_x( 'PubliƩ le %s', 'PubliƩ le DATE', 'chosen' ), $  date );     ?> </span> 

Any idea what happened?

Postgres Query conversion (Count, updated date)

I currently run the below query in Snowflake for some of my reconciliations- have never worked in PostgreSQL but we just adopted it.

Select count(1), min (LAST_UPDATED_DATE), max(LAST_UPDATED_DATE) from "SOURCE"."SCHEMA"."TABLE"

I’m looking to do the same thing in PosgreSQL. It’s one that we can run against a table that will give us the last updated date and a count when checking that movements completed.

I know postgres can be time heavy on counts and some of these tables are massive. That aside I’m not sure how to rewrite this either. Any pointers/tips would be amazing

thanks,

zach

mysql partition by date and id

At the moment I’m partitioning my table daily by

PARTITION BY RANGE COLUMNS(date) 

On a daily basis I load data into that table, I have billions of rows in that table. I was thinking on switch to exchange partition for better performance. However the data is getting from multiple sources at different times. I do however can do exchange partition if I could do partition the table by (date, sourceId).

Is that possible? Do I have to use sub-partitions or is there other ways to solve it?

I would like to know if there is a plugin or how to do it, so that a site on that multisite network on a specific date

I have a network of sites (multisite), where I rent a site (plans), I would like to know if there is a plugin or how to do it, so that a site on that multisite network on a specific date.

For example:

1 customer rented a website for 2 months.

I want who on the last day of these 2 months, the site goes down with a message (expiration, canceled, contact us to activate).

Can someone help me?

How can I tranlslate post date in italian?

I’m using this filter to display post date in my single and archive pages, because working on a windows azure php app I can’t show post date before 1901.

This filter is working but It displays post date in english

add_filter( 'wp_date', function($  the_date, $  d, $  post){   $  date = new DateTime( $  post->post_date );  echo $  date->format('j F, Y'); // change formatting as needed  }, 10, 3 ); 

I need to display the post date in italian. How can I do that?

Thanks guys

Filter records and find those with minimal date

I have the following tables in Microsoft SQL Server:

  1. Users: Includes uID (primary key), birthDate, name
  2. Conversations: Includes convID (primary key), hostID (foreign key for uID in Users)
  3. Participants: Includes uID (foreign key for uID in Users), convID (foreign key for convID in Conversations).

I need to write a query which finds the name, ID and birth date of the oldest user who didn’t participate in any conversation, and that his name contains the letter ‘b’. If there is more than one user, I need to return all of them.

I don’t know how to both filter the users, and than find those with the minimal birth date (the oldest).

Search results sort order failing: set by date only

Hi the default wordpress search seems to be for "piano"

 SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE '%piano%') OR (wp_posts.post_excerpt LIKE '%piano%') OR (wp_posts.post_content LIKE '%piano%'))) AND wp_posts.post_type IN ('post', 'page', 'attachment') AND (wp_posts.post_status = 'publish' OR wp_posts.post_author = 5 AND wp_posts.post_status = 'private') ORDER BY wp_posts.post_title LIKE '%piano%' DESC, wp_posts.post_date DESC LIMIT 0, 25  

however I need them all sorted by date first. My search results by date are skewed:

2020-10-25   2020-10-22   2020-10-20   2020-10-20   2020-10-16   2020-10-13   2020-10-10   2020-10-07   2020-10-06   2020-10-02   2020-09-30   2020-09-28   2020-09-02   2020-08-09   2020-07-21   2020-07-21   2020-05-21   2020-04-24   2020-03-06   2019-06-02  <- here it is skewed onwards 2019-06-01   2020-10-25   2020-10-24   2020-10-23   2020-10-23 

So I asume it is because the SQL query sorts by title first.

So I tried this solution:

 function changeSearchSort( $  orderby, $  query ){     global $  wpdb;      if(!is_admin() && is_search()) {         $  orderby =  $  wpdb->prefix."posts.post_date ASC";     }     return  $  orderby; } add_filter('posts_orderby','changeSearchSort',10,2);  

from here How do I change WP search results order?

and it does not work.

I have tried this:
a) disabled all plugins
b) different themes

still not working.

Help appreciated

cheers

Ben