Implementing custom tag/tax pages

You can use the tag_template or taxonomy_template filters and check the queried object from within that, then use locate_template to get the template path. function wpd_tag_template_filter( $templates=”” ) { $this_tag = get_queried_object(); // check $this_tag->term_id, $this_tag->slug, etc. $templates = locate_template( ‘my_custom_template.php’, false ); return $templates; } add_filter( ‘tag_template’, ‘wpd_tag_template_filter’ );

WordPress theme layout problem

Normally WP themes dont have block regions to place stuff inside. You have some themes with page builders, but what you want to achieve is mostly done by adding code to the header.php.

Is there a way to switch to another theme?

switch_theme() is the function you need but this… why is someone changing the stylesheet and no longer changing the theme? … indicates a misunderstanding. You provide the $stylesheet as an argument but you are switching the theme as a whole not just the stylesheet. And, for reasons unknown, $stylesheet isn’t the stylesheet. It is: $stylesheet … Read more

Trying to change active theme on all sites in Multisite

Use switch_theme( ‘theme_name’ ) to switch a theme Use wp_get_sites( array(‘network_id’ => $wpdb->siteid) ) to retrieve all sites info including the blog_id Loop through the retrieved blog ids and execute code within the scope of each blog using the switch_to_blog() function: foreach( $blog_ids as $blog_id ){ switch_to_blog( $blog_id ); //Do stuff restore_current_blog(); }

Override index with a custom PHP page

Create a new theme folder next to your current theme and name it, ThemeName Child Theme In the new child theme folder create a file names style.css In the header of that file add this, /* Theme Name: My Child Theme Theme URI: http://www.example.com/myTheme Description: your Child Theme Author: your name Author URI: http://www.example.com Template: … Read more