Api rest_route 404 while building filter for custom posts (filtered by multiple meta keys / custom fields)

As I said in my comment, I made a POST request to your custom endpoint (here) and then received a 404 error with this message: “No route was found matching the URL and request method.“, which likely means the route was never registered, or that the request method was not supported, i.e. not in the … Read more

Custom ordering of CPT items not matching with the ordering of its pagination

Is there a way to match the pagination ordering the same way the CPT items are ordered? The custom pagination function that you’re using (understrap_post_nav()) is using the default functions for navigating between singular posts like previous_post_link() and next_post_link() which do not support custom (posts) queries, so custom coding is needed to achieve the pagination … Read more

I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states

Your “states” appear to be terms in a custom taxonomy. In the code below I’ve assumed the taxonomy’s name is my_state; you’ll need to make sure that’s updated to match the actual taxonomy name. add_filter( ‘the_title’, function( $title, $id ) { // Gets the list of ‘states’ the post belongs to. $states = wp_get_post_terms( $id, … Read more

sortable columns for multiple custom post types not working

I thought if I used manage_edit-post_sortable_columns I could target the ones I have conditionally checked for? That hook runs only on the “Posts” page (at wp-admin/edit.php) for managing posts in the default/core post post type. I.e. When the post_type parameter in the (current page) URL is not set or empty, or that it’s set to … Read more

Template for custom post type when taxonomy is in the URL

Your taxonomy’s rewrite base is actually book_types (see the “rewrite” => [ ‘slug’ => ‘book_types’, ‘with_front’ => true, ] in your code), so the taxonomy archive pages are accessible at the /book_types/<term slug> path.. and not /books/<term slug>. So it’s normal if /books/fiction shows a 404 error page, unless of course if there’s a post … Read more