Tag Info

New answers tagged

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( ...


0

You need to do the following in a child theme, do not make changes to the theme itself. EDIT I had a good look at the 'Heuman' theme. I think to solve your problem here is to copy the following files to your child theme, content.php and archive.php Rename your content.php to something like content-archive.php. Open it up and delete the following lines ...


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( ...


0

The standard way to create the tag-archive page link is to ask it to WordPress with: echo get_tag_link($tag_id_or_tag_object) the function is smart enough to deal with id(s) or full tag objects like the ones returned by get_the_tags(). See here for more about the tag link: http://codex.wordpress.org/Function_Reference/get_tag_link


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 ...



Top 50 recent answers are included