Showing sidebar-2 on custom template page

you can put this code in your functions add_action( ‘init’, ‘register_my_menus’ ); function register_my_menus() { register_nav_menus( array( ‘menu-1’ => __( ‘Head’ ) ) ); } and this code, in the place you want your second menu <?php wp_nav_menu( array( ‘theme_location’ => ‘menu-1’ ) ); ?> and than, you can control your new menu, through the … Read more

How to make page template with admin able to select NextGen Galleries to be part of the layout?

You can add galleries directly to a template by calling do_shortcode() to run the gallery shortcode. <?php echo do_shortcode(‘[nggallery id=”1″ template=”example”]’); ?> Edit: sorry, writing decaffeinated so short attention span 🙂 Add some custom fields to your product pages to let your client pick which gallery goes on that product. If you like, just use … Read more

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

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.

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