Can you programme the selected page template to display block patterns automatically?
Can you programme the selected page template to display block patterns automatically?
Can you programme the selected page template to display block patterns automatically?
Links in archive not including taxonomy parameter
add_rewrite_rule not working in Custom Post Type UI Plugin
Add Category names to post lists of custom post type
Error 403 when posting comments to a custom post type from a different page
The issue was, in fact, the new taxonomy using “year” clashes with the query. WordPress was accepting year=about-us in the query chain for instance, as year was a taxonomy, before the expected page=about-us – preventing it from appearing as a page and using the index.php template as there is no “year” template. I changed year … Read more
You would use the code on your (archive) template file, which you use to display the custom posts. On the template the code would be placed within the Loop. For example you could have a custom post type specific archive file for this (more on Template Hierarchy). // archive-$posttype.php while ( have_posts() ) : the_post(); … Read more
You can do this without losing SEO. Change the taxonomy slug from “watches-product” to “watches/product” register_taxonomy(‘wpsc_watch_product_category’, ‘wpsc_watch_product’, array( ‘hierarchical’ => true, ‘query_var’ => ‘watch_product_category’, ‘rewrite’ => array( ‘slug’ => ‘watches/product’ ), ‘labels’ => $labels, )); Install a 302 Redirect Plugin. This plugin will redirect all the traffic to new url.
Off the top of my head, without actually testing it, this should work. You want to test for is_admin so we don’t go running the code on the front end, then also test for the post type being equal to its slug. Edited this because I made a silly mistake before. Reference this page of … Read more
Filter template_include, check if the current post is a product and load the product template. Example: add_filter( ‘template_include’, function( $template ) { if ( ! is_singular() or ! get_post_meta( get_the_ID(), ‘price’, true ) ) return $template; return locate_template( ‘product-single.php’ ); }); How exactly you determine if a post is a product is up to your … Read more