Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14318 reviews 1707 hosting providers

Questions & Answers

WordPress conditional Statement for Parent Pages

Jan 5, 2013 by Maria
I am currently working on a WP template page for a few different pages, some of these pages are parent pages and some are  childe pages. My parents pages don’t have a title, but the child pages. I want to write a conditional statement that would call the <h1>><?php my_title(); ?></h1> of the child pages. How can I do this?
Please help

1 Answer

0 votes
Jan 5, 2013 by WebGuru

<?php if( $post->post_parent ) { ?>
<h1><?php My_title(); ?></h1>
<?php } ?>