Can Multisite and Custom Post Types work this way?

You can put something like this in a theme template: <?php switch ( get_current_blog_id() ) { case 9: $category = ‘alignment’; break; case 13: $category = ‘lists’; break; case 14: $category = ‘comments’; break; default: $category = ”; break; } switch_to_blog( BLOG_ID_CURRENT_SITE ); // root site. $category_posts = get_posts( array( ‘category_name’ => $category, ) ); … Read more

How to work with URLs where sometimes a post or a subcategory is in the same part of the URL structure

Your challenge lies in the way WordPress interprets URL patterns and resolves them to query variables. When you have a URL structure where the third segment can be either a subcategory or a product name, WordPress struggles to differentiate between the two. This is a common issue in WordPress when using custom post types and … Read more

How to check if a custom post type uses a custom template?

I mean “Full Width” like we do with pages : is_page_template( ‘Full Width’ ) ? is_page_template() does not accept a Template Name value like Full Width, but instead, a file name such as full-width.php or templates/full-width.php. Secondly, is_page_template() can be used with any post types and not just Pages (page post type), so you can … Read more