Avoid removing duplicate posts

It’s a bit less efficient, but if you have an array of IDs, possibly including duplicates, and want to get the posts for each, I’d suggest use get_post() on each ID, giving you an array of posts. $post_ids = [ 24, 11, 60, 11 ]; $posts = array_map( ‘get_post’, $post_ids ); global $post; foreach ( … Read more

Update wp_query every week

I see two approaches: via cron job… or website / page cache which lasts 1 week. In case you want to do the cache option: you just need to add ‘orderby’ => ‘rand’ to your WP_Query and install a caching plugin for your page, then set it up for 1 week. CronJob: you need to … Read more

How can I re-query post_type and rewrite the url?

I think you need to first define property_com_listing_type as a query: https://codepen.io/the_ruther4d/post/custom-query-string-vars-in-wordpress Then you can rewrite the urls with add_rewrite_rule (do not forget to save permalinks after change): https://codex.wordpress.org/Rewrite_API/add_rewrite_rule with a regex like ^category/([^/]+)/([^/]+)/? Then you can modify the query using pre_get_posts: https://developer.wordpress.org/reference/hooks/pre_get_posts/