0
votes
1answer
161 views

Get all children page ID's including parent by title

So I am getting all the children ID's as well as the parent ID to show content only for that page and all its sub-pages. This is the following function I created, but was wondering if there is a ...
0
votes
2answers
129 views

Subpage Conditional

I am looking for a way to write a condition for a subpage...in other words if we're on the subpage "duck" then do something...if not do something else. I found some code I thought would work, but it ...
1
vote
2answers
98 views

Determine page content based on page parent

How can I display a gallery shortcode for pages who are children of the page with an ID of 9, and the regular content for pages who aren't? This is what I've tried so far, but it's not working: ...
0
votes
1answer
224 views

How do I display something on a particular category page?

How would I display HTML conditional on a particular category page? Say my permalinks to the category pages are http://www.mysite.com/category/awesome-category How would I cast the <?php if ... ...
0
votes
2answers
246 views

Check if has pages?

So hard to find this info... I'd like to know a way to find out if there are pages. Something like: if (has_pages()) { /* do something */ } I can't find a reference to any similar function... how ...
1
vote
4answers
4k views

Why isn't is_page working when I put it in the functions.php file?

I have page called "Apple", the page's ID id 2533. In page.php file I have line: echo $bannerimg And this function in functions.php: if ( is_page( '2533' ) ) { // also tested with ...
1
vote
3answers
349 views

A function like is_page() but returns true if on any sub page of given page

In my header I use this code: if(is_page("stores")) { // Do something } I run some code if on the page stores but what I want to do is run that code if the page is stores or any page that is a ...