redirect automatic page that serves custom posttype content

I solved my own question without breaking the url structure logic, as Krzysiek Dróżdż (thanks!) suggested. I changed the page named /page-actueel-blog to the custom-post-type ‘archive’ template. Pretty obvious, but I thought archive was something else entirely. For whoever may have the same doubts: the archive template is the level up from domain.com/blogpost (single-mycustomposttypename.php); a … Read more

Listing posts under primary and secondary taxonomies

This only takes care of two levels. You could make a recursive function, if you have ‘unlimited’ levels. $custom_terms = get_terms(‘custom_taxonomy’); /** * Loop through all taxonomies */ foreach($custom_terms as $custom_term): // Reset query (for good measures sake) wp_reset_query(); // Set the args (getting ready to get posts that are in the given taxonomy) $outer_args … Read more

Custom post type not showing in search result

Please add exclude_from_search to false, inside your register post type function add_action(‘init’, ‘eyewebz_create_post_types’); function eyewebz_create_post_types() { register_post_type(‘project’, array( ‘taxonomies’ => array(‘category’), ‘labels’ => $labels, ‘has_archive’ => true, ‘show_in_rest’ => true, ‘hierarchical’ => true, ‘public’ => true, ‘publicly_queryable’ => true, ‘supports’ => array(‘title’, ‘editor’, ‘post-formats’, ‘page-attributes’, ‘thumbnail’, ‘excerpt’), ‘exclude_from_search’ => false, ‘menu_icon’ => ‘dashicons-index-card’ )); }

Including metaboxes from custom post types in global search — continued

I’ve figured out a fix. First, to fix bad results for an empty search, I require that (!empty(get_query_var(‘s’)) Before setting the “meta_query” query variable in my plugin. I thought the fix would be with the posts_request filter, but it continued to replace select SQL_CALC_GET_ROWS wp_posts.ID with select SQL_CALC_GET_ROWS wp_posts.* Even when I replaced the * … Read more