How to check during “pre_get_posts” if WP performing default query for specific custom template?

As you describe the timing would not quite work. During WP core load: main query is created and processed into query variables (with pre_get_posts being one of the hooks able to influence the results) then template-loader.php uses conditionals (dependent on those query variables) to determine template to use So at the point of pre_get_posts you … Read more

Custom Post Type Template based on Taxonomy

I’m afraid you have to do this manually. You can put someting like this in your single-vehicles.php file: if ( … ) { // check if it’s in used category/term get_template_part(‘part-single-vehicles-used’); } else { get_template_part(‘part-single-vehicles-new’); } And then put new car template into part-single-vehicles-new.php file and used car template into part-single-vehicles-used.php.

How can I change the look of a post as is displayed

In TwentyTwelve index.php: <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( ‘content’, get_post_format() ); ?> <?php endwhile; ?> the line in the middle is loading the content.php to show the posts on the homepage. a. In content.php, the_post_thumbnail() in line 18 is responsible for the image, specifically the Featured Image, of a post. … Read more

Search results in custom template

You need to declare the variable as global in resources-search.php: <?php global $YearList; // Rest of file… May I ask why you’re hardcoding the years, instead of… $YearList = range( 2000, 2013 ); $YearList = range( 2000, date( ‘Y’ ) ); // From 2000 to current year

Show uploaded images in full size

WordPress creates 3 different sizes as far as my research goes. Read this on WP image handling -> http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/ You can easily customise the default Media sizes by changing the default sizes in Dashboard > Settings > Media. You can grab any of those sizes. See the codex @ http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail The function you want is: … Read more

Permalink / sub-template issue

It is hard to tell exactly what you’ve done, and it sounds a bit messy, but I think you’ve created “Pages” using the child templates as the “Template” under page attributes. That, or you are linking to them directly with wp-content/theme/themename/templatename.php. You never want to link directly like that, but if that were the case … Read more

changes to templates not showing on server

After many attempts, i had to make changes to the core template files in directory plugins/woocommerce and it worked, for safety i then copied the woocommerce/templates to mytheme/woocommerce/templates and surprisingly it worked! strange but at least it did.