Highlighting current item of custom post types’ sub pages, listed by wp_list_pages

The problem with this code is that the query is being altered and current_page_item is being lost. This is the part causing problems. $post = get_post( $getid ); setup_postdata( $post ); If you comment out those two lines you’ll see that current_page_item appears. There are also some secondary problems with this code that have no … Read more

Category as Class for Custom Post Type

This is expected (or at least: designed) behavior. Here is a portion of the Codex on that: The post_class CSS classes appear based upon the post pageview Conditional Tags as follows. Category Category template files and pageviews displaying posts feature the class selectors: post post-id category-ID category-name Of course, you can hook a custom filter … Read more

How to disable a Custom Post Type Feed?

I’m also getting an error similar to that. The feed links get generated and put into the and that is where your 404 error is coming from. Here’s some code to disable feeds for a custom post type. https://gist.github.com/jaredatch/8610187#file-gistfile1-php <?php /** * Disable the “foo” custom post type feed * * @since 1.0.0 * @param … Read more

Filtering a WP Query result

I solved my problem re-reading ACF’s custom fields documentation. Instead of meta_query, I should’ve used meta_key. The correct argument for a custom field is: // args $args = array( ‘numberposts’ => -1, ‘post_type’ => ‘event’, ‘meta_key’ => ‘location’, ‘meta_value’ => ‘Melbourne’ );