Web development tip: If you’d like do include something specific on a page that is a parent of a certain page in WordPress, use this code in your template file:
if ( $post->post_parent == '2' ) { // stuff }
where ‘2’ is ID of the parent page
By browsing this site you agree to our use of cookies. Ok. Close
Web development tip: If you’d like do include something specific on a page that is a parent of a certain page in WordPress, use this code in your template file:
if ( $post->post_parent == '2' ) { // stuff }
where ‘2’ is ID of the parent page
Comments are closed.
I am freelancer based in Bristol, UK, specialising in web design and front-end development, with passion for quality code, pixel perfection and problem solving.
Hire Me