Timeline for Conditional tag to check if 'page.php' is being used?
Current License: CC BY-SA 3.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 27, 2020 at 15:11 | answer | added | Robin | timeline score: 0 | |
Feb 1, 2019 at 13:14 | answer | added | Sainul Abid | timeline score: -2 | |
Sep 24, 2018 at 5:53 | answer | added | t-jam | timeline score: 7 | |
Jul 29, 2018 at 10:22 | answer | added | NineTheme | timeline score: 0 | |
Apr 2, 2018 at 6:07 | answer | added | Assaf Katz | timeline score: 0 | |
Nov 22, 2017 at 13:28 | history | tweeted | twitter.com/StackWordPress/status/933326316115505152 | ||
Sep 20, 2016 at 16:01 | answer | added | Rarst | timeline score: 1 | |
Sep 20, 2016 at 15:15 | answer | added | intagli | timeline score: 12 | |
S Jun 17, 2014 at 7:48 | history | suggested | engelen | CC BY-SA 3.0 |
Formatting
|
Jun 17, 2014 at 7:47 | comment | added | engelen |
The most important question here is: are you checking inside the loop? Are you calling the_post in your template file before calling is_page_template ? (is_page_template( 'page.php' won't work either way, but this is still an important question in answering your original question)
|
|
Jun 17, 2014 at 7:43 | review | Suggested edits | |||
S Jun 17, 2014 at 7:48 | |||||
Jun 17, 2014 at 2:58 | comment | added | jdm2112 |
Unfortunately I'm not able to answer my own question from your edit. Too many possibilities without seeing more of your code. If you are testing the condition inside of the loop, is_page_template will not work. My recommendation is to find out which template is being use and then track down why. This function will display the current template file on every page to a logged in admin. pastebin.com/wkNv9Eug. Stick this in your functions.php and reload the page. As long as your theme calls wp_head() you should see the template at the top of every page when logged in.
|
|
Jun 17, 2014 at 0:40 | comment | added | user1981248 | Hi, I'm checking it in a file which I'm including (using 'include()') at the top of page.php and other files. Please see the edit of my question. | |
Jun 17, 2014 at 0:39 | history | edited | user1981248 | CC BY-SA 3.0 |
added 417 characters in body
|
Jun 16, 2014 at 22:15 | comment | added | jdm2112 | is_page_template() is the correct function but you say it "doesn't work". Are you checking inside the loop? | |
Jun 16, 2014 at 21:40 | history | asked | user1981248 | CC BY-SA 3.0 |