Tag Info

Hot answers tagged

1

I'm working on a plugin that handle things like that. While it's in development I want to share some code derived form my plugin that can help you, I hope. If you look at your sources urls, they are easily to be recognize: you have 2 cases in which you need to redirect: the url contain 2 pieces and both are numeric, first of 4 digits, second is between 1 ...


1

Yep. You can add a meta_query parameter to methods that query posts, such as WP_Query. This one below gets a custom post type between two dates (which are custom fields created by 'advanced custom fields' plugin) and sorts on one of these dates: $args = array( 'post_type' => 'event', 'posts_per_page' => '-1', 'post_status' => array( ...


1

When the wp_enqueue_scripts action fires, the main query has already run and the posts are in the global $wp_query. We just need to grab the ID from each object in $wp_query->posts, the wp_list_pluck function makes that easy: function wpd_get_post_ids(){ if( is_archive() ){ global $wp_query; $post_ids = wp_list_pluck( ...



Only top voted, non community-wiki answers of a minimum length are eligible