pixelentity said
echo get_page_template_slug( get_queried_object_id() );to check if page template slug is correct BF
Thanks for your answer. Have pasted it in my template. At page-home.php it returns page-home.php, but for my templates like page-portfolio-4-columns-isotope.php it returns nothing. How could it be, is it a bug or what?
In these page templates I have 2 loops and after one of them I didn’t have this:
<?php wp_reset_query(); ?>
After I have added it everything works fine now. Thanks for everyone’s responses!
I remember I had a similar issue one time and it was caused by numbers in the file name. May try to rename the file to page-portfolio-two-columns-isotope.php.
infuse01 said
I remember I had a similar issue one time and it was caused by numbers in the file name. May try to rename the file to page-portfolio-two-columns-isotope.php.
Have tried already but didn’t help, as I have said only this have helped:
<?php wp_reset_query(); ?>
- Sold between 250 000 and 1 000 000 dollars
- Exclusive Author
- Interviewed on the Envato Notes blog
- Author was Featured
- Item was Featured
- Beta Tester
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
Did you assign the right page template to the pages you’re checking?
When you check the page template:
is_page_template(‘page-portfolio-2-columns-isotope.php’)
you must be sure that page-portfolio-2-columns-isotope.php is a page template and that it’s assigned to the page you’re checking.
I’m sure you did something wrong here, otherwise it’s impossible to have is_page_template() to fail… no bugs inWP, believe me 
Parker
ParkerAndKent said
no bugs inWP, believe me![]()
oh theres bugs…. they’re mean little ** 
- Sold between 250 000 and 1 000 000 dollars
- Exclusive Author
- Interviewed on the Envato Notes blog
- Author was Featured
- Item was Featured
- Beta Tester
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
OrganicBeeMedia said
ParkerAndKent saidoh theres bugs…. they’re mean little **
no bugs inWP, believe me![]()
![]()
I meant no bugs with the is_page_template function
WP has many bugs, I fight with them everyday 
ParkerAndKent said
Did you assign the right page template to the pages you’re checking?When you check the page template:
is_page_template(‘page-portfolio-2-columns-isotope.php’)
you must be sure that page-portfolio-2-columns-isotope.php is a page template and that it’s assigned to the page you’re checking.
I’m sure you did something wrong here, otherwise it’s impossible to have is_page_template() to fail… no bugs inWP, believe me
Parker
Yes, I have assigned the right page template to the pages I am checking. Ok, if u are thinking I have done something wrong, try this page template on your server http://pastebin.com/KTQ0dfqj then in your functions.php try this:
/**
* Initialize jQuery Plugins.
*/
function index_initialize_jquery_plugins() {
<script>
jQuery(document).ready(function(){
<?php if ( is_page_template('page-portfolio-4-columns-isotope.php') ) : ?>
// script goes here... Do u see me?
<?php endif; ?>
});
</script>
<?php
}
add_action( 'wp_footer', 'index_initialize_jquery_plugins' );
Then tell me please do u see this?
// script goes here... Do u see me?
at your front end under the footer? And one more is_page_template() doesn’t work within the loop. Due to certain global variables being overwritten during The Loop is_page() will not work. In order to use it after The Loop you must call wp_reset_query() after The Loop. http://codex.wordpress.org/Function_Reference/is_page_template
