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

Multiple search template with separate stylesheets

I’ve never used is_page_template() but I have had good luck with is_page(‘new_search’) regardless of which conditional you use some things to check. Is the is_page_template(‘new-index.php’) working. you may test this by doing something like: if ( is_page_template(‘new-index.php’)) { wp_die(‘new search page’);} You should also use wp_register_style and wp_enqueue_style in your functions.php hooking in the the … Read more

Using page template as Static Front Page

If you want the page to display your blog posts then you need to either change the front page reading option to latest posts then use either index.php or create a new file named front-page.php. If you want your page query ordered by menu_order you need to add ‘orderby’ => ‘menu_order’ to the query.

Permalink / sub-template issue

It is hard to tell exactly what you’ve done, and it sounds a bit messy, but I think you’ve created “Pages” using the child templates as the “Template” under page attributes. That, or you are linking to them directly with wp-content/theme/themename/templatename.php. You never want to link directly like that, but if that were the case … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)