How to get post creation date?

The post_date and post_date_gmt serves as the date that the post was created. For scheduled posts this will be the date on which the post is scheduled to be published. There is no reliable native method to determine the date when a scheduled post was added. For scheduled posts, you can try the post_modified or … Read more

Make categories appear random

You could hook into the pre_get_posts action hook and set the posts’ order to random only for specific categories. Here’s a basic example on how to achieve so: function sort_posts_randomly( $query ) { if ( ! is_admin() && $query->is_main_query() ) { if ( is_category( ‘category id, slug, or name’ ) ) { // Sort the … Read more

How to search through “post title” and “tags” using WP_Query?

Try getting rid of the “0” key in your tax_query and meta_query array. $query_args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘order’ => ‘ASC’, ‘orderby’ => ‘none’, ‘posts_per_page’ => ‘100’, ‘offset’ => ‘2’, ‘page’ => ‘2’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘name’, ‘terms’ => array(‘test’), ‘operator’ => ‘IN’, ), ‘relation’ … Read more