Articles of date

date() returns incorrect value if used from WordPress theme, but correct otherwise

As I have mentioned in title if I use date(‘H’) function in WP theme, it simply returns UTC time, but the server is set to use timezone Europe/Riga and the same is set in WP General settings. At the same time if I use the same function in empty PHP test file it returns correctly […]

Ordering posts by custom field and grouped by month

I need display all custom posts (event), order them by custom field (date) and group by month: September Event 1 Event 2 August Event 3 July Event 4 Event 5 I know, it is frequently asked question here, but despite the reading many similar issues, I can’t do anything meaningful according them. So all posts […]

Month display in English but required in Swedish?

I am using WordPress settings like below Image: On post output come like 13 October 11:49 but my requirement is to make it like oktober in Swedish and same for all other months. Thanks!

How to display a WordPress Custom Field only on a specific day of the week?

I’ve got WordPress site for which I’ve set up a custom post_type along with some custom fields created with CMB2 to display extra stuff within my custom posts. When editing a single item for my custom post_type, it has a repeatable fields group set up in order to store prices and additional info, those are […]

Auto update post title and slug when post status is changed

I need help. Thanks in advance. I need a function that update post title and slug with some default title + current date when post status is updated from draft to published. I use this one to update the post date on status change but I need to add a functionality the title also to […]

Convert all dates stored in custom field

I have a custom field to store the date of games, and I store it in database like mm/dd/yyyy Now I need to convert all dates to dd/mm/yyyy So how can do that? Is timestamp a solution for it, if yes, how can do that I need to change all old data to new data […]

How to remove Date from Meta Description on SERP?

I noticed on a few recent projects the Date is displaying in the Meta Description for all Custom Post Types and Taxonomies in WordPress. I was always under the impression the Date would usually show for ‘Posts’, which has always made sense. Then for Pages and Taxonomies – which would normally be evergreen content in […]

wordpress meta value compare between two date

I want to check date between two year of birth. But my saved value is date of birth. Meta key “birth_date”. Now I want to check value between years using year. My saved date format like “01/01/1995” Here I applied below code to fetch value. $studentdata = get_users( array( ‘meta_query’=> array( array( ‘key’ => ‘birth_date’, […]

Translate current_time

I have current_time in theme and it displays date like: THURSDAY, NOVEMBER 10, 2016. But I need to translate it to Persian. How can I do this?

Post: how to set created date after post has been published

For example: i click create post at Friday i edit post data i left this post opened and not published till Monday i publish this post at Monday as published date i see Friday. But why? I want to see as published date Monday, not Friday. What and where should i change? I’m using WordPress […]