What are the package and subpackage comment for?
These are PHPDoc tags – used to generate meaningful (and automated) code documentation
These are PHPDoc tags – used to generate meaningful (and automated) code documentation
Apparently global does the trick. The problem was that my variable $categories should have been redefined with a global in front of it, in each template I needed to use it.
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
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
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
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
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
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
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?
Hook in wp.media to add a new tab