How can I create a bash install script for my WordPress sites setup (WP+plugins+theme)?

To always get latest plugin take for example my plugin: http://wordpress.org/extend/plugins/wordpress-file-monitor-plus/ the download link for the latest is: http://downloads.wordpress.org/plugin/wordpress-file-monitor-plus.1.1.zip but if you remove the version from the download link you always get the latest version: http://downloads.wordpress.org/plugin/wordpress-file-monitor-plus.zip EDIT: Have you considered keeping a folder of the latest wordpress and plugins unpacked? Then as soon as a … Read more

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

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

How do register_sidebar() and get_sidebar() work together?

You just call get_sidebar() from index.php and it loads the theme file sidebar.php. register_sidebar(), on the other hand, is used for widgets where plugins and such want to dynamically add content in your sidebar.php file if your theme supports it. In your case, is there a file called sidebar-footer.php in your theme’s directory?