Output Buffer Issue with Single Post View

Most likely, that comments.php file is being included or required more than once. You can make sure that any call to that file is done with include_once or require_once to prevent that issue. Otherwise, a safe workaround would be to wrap the file contents with: if ( ! function_exists( ‘basey_comment’ ) ) : # code … Read more

Display an image of selected template in admin to aid user when using complex templates

Preliminary Tasks Create a directory within your theme to contain your layout thumbs. Add layout thumbs to reflect the file names of your template. The following script uses the format tpl-homepage.php. The image would be named homepage.jpg. Please note, the following is a proof-of-concept. Approach 1: Only JavaScript Load the following only for post.php and … Read more

Multiple sub directories for theme template pages

When I want to change a specific part of template, such as header OR footer then I use conditions like this – if(is_404()) { get_header(`error`); //loads header-error.php } else { get_header(); //loads header.php } In your case, you want to load a completely different template, Now the only action hook I can imagine is – … Read more

what is template-name.php

I always name them like so: page-name.php; This keeps my page templates nicely together + in some cases this can make your code easier, for example… <?php // Get the file called loop-page.php get_template_part( ‘loop’, ‘page’ ); ?> A quick Google revealed also this http://wp.tutsplus.com/tutorials/organizing-and-naming-your-themes-template-files-for-clarity-and-convenience/ Cheers