Show different theme for admin?

I just wrote this quick plugin and it seems to work. Let me know if there is a better way. <?php /* Plugin Name: Theme Switch if Admin Description: Display different theme to user if logged in as admin Author: Kyle Barber */ add_filter(‘template’, ‘change_theme’); add_filter(‘option_template’, ‘change_theme’); add_filter(‘option_stylesheet’, ‘change_theme’); function change_theme($theme) { if ( current_user_can(‘manage_options’) … Read more

Difference between a theme and a plugin?

Themes manage the display and layout of your blog, but can also add functionality. Plug-ins add functionality to your blog, but can also add elements to the layout. There is a lot of crossover between the two, particularly when you being to bundle certain plug-ins with themes. However, the biggest difference lies in the templates … Read more

Different template of products for specific category. WooCommerce

You could change your single-product.php to just be a redirect to the correct template depending on what product category the current product it. To do so you’d copy single-product.php to your theme’s woocommerce folder. Rename it to single-product-default.php or anything. Create another copy and call it single-product-coffee.php. You can make whatever changes you’d like to … Read more

How to set thumbnail image for a (child) theme

Create image file in PNG Format having name screenshot.png and save it in themes root folder.The recommended image size is 880×660. Even recommended image size is 880×660 though it will only be shown as 387×290 but the double-sized image allows for high-resolution viewing on HiDPI displays. For more information see this page. If you don’t … Read more

How to get category and archive title?

For category use single_cat_title function: http://codex.wordpress.org/Function_Reference/single_cat_title For tag use single_tag_title function: http://codex.wordpress.org/Function_Reference/single_tag_title For date use get_the_date function: http://codex.wordpress.org/Function_Reference/get_the_date For example if you open twentyten theme you will see following: category.php: <h1 class=”page-title”><?php printf( __( ‘Category Archives: %s’, ‘twentyten’ ), ‘<span>’ . single_cat_title( ”, false ) . ‘</span>’ ); ?></h1> date.php: <h1 class=”page-title”> <?php if ( … Read more

CSS classes for theme

There are many CSS classes generated by WordPress, depending on context. The Theme Review Guidelines include the following, WordPress-generated CSS classes: Alignment Classes: .aligncenter .alignleft .alignright Caption Related Classes: .wp-caption .wp-caption-text .gallery-caption Post Classes: .sticky Comment Classes: .bypostauthor Then, there are the body classes generated by body_class(). Then, there are the post classes generated by … Read more

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