Custom Taxonomy Filter Issues

I believe that the problem is with this line: $var = &$query->query_vars[$tax_slug]; &$query is not necessary, simle $query should be enaught. $query->query->vars[$tax_slug] returns not an ID of term, but term’s slug So $term = get_term_by( ‘id’, $var, $tax_slug ); should be changed to $term = get_term_by( ‘slug’, $var, $tax_slug ); But is not necessary as … Read more

Custom post type archive – error in nav-menu-template.php

print_r($queried_object) right before line 439 generates the following – there’s no ‘ancestors’ key: When you are on a post type archive calling get_queried_object (which the code probably does) or using WP_Query::$queried_object return the post type “object”. All that is is the arguments with which the post type was registered. The relevant bit of nav-menu-template.php in … Read more

Custom post type 404 error on “default” or “numeric” permalinks

The URL you are trying to access– mysite.com/reading-list/— is constructed by the WordPress rewrite rules. The path /reading-list/ doesn’t actually exist. If you are using the default ?p=123 links, those rewrite rules are not used. The default links are just GET strings. In other words, since there is nothing at mysite.com/reading-list/ without the rewrite rules … Read more

Displaying information from custom field on custom post type

I think you are passing a wrong post ID value to the get_post_meta() function. Try this: $ytubeID = get_post_meta(get_the_ID(), ‘_youtubeID’, true); $vimID = get_post_meta(get_the_ID(), ‘_vimeoID’, true); Note:, as you are using a new instance of WP_Query, you don’t need wp_reset_query();, use wp_reset_postdata(); instead. Until you add the full code that you are using to store … Read more