change the Theme dynamically

Filter pre_option_stylesheet. Sample code, not tested: add_filter( ‘pre_option_stylesheet’, ‘wpse_100854_switch_stylesheet’ ); function wpse_100854_switch_stylesheet( $false ) { if ( empty ( $_GET[‘theme’] ) return $false; $themes = wp_get_themes( array( ‘allowed’ => true ) ); if ( isset ( $themes[ $_GET[‘theme’] ] ) ) return $_GET[‘theme’]; return $false; } The URL should look like example.com/?theme=theme_directory_slug. To change just … Read more

Edit php files in subdirs in a child theme

Any suggestions? For one, read and interpret the error message. “Cannot redeclare require_once_child()” is pretty straightforward: Don’t give two functions the same name. I am uncertain whether your general idea is sensible in the first place, but should it be, this function require_once_child() { require_once(‘includes/sf-content-display/sf-post-formats.php’); } add_action( ‘init’, ‘require_once_child’ ); is all you need.

Functions.php in Child Theme – load JS

I also working on ait theme template, If you want to add new css & js file into child theme so u first create function.php file in child theme directory & after that u can write following code… <?php define(‘CHILD_THEME_DIR’, get_bloginfo(stylesheet_directory)); /* this is my child theme css folder */ define(‘CHILD_THEME_CSS_DIR’, CHILD_THEME_DIR . ‘/assets/css’); /* … Read more