Conditional logic depend on parent page
-
Hello there,
I have little catalog based on WP pages. I wanted to apply contact form for product pages, but faced with a problem – I need to load different contact form depend on parent page. So I come up with this code:
<?php if ( is_page(215) && $post->post_parent ): echo 'contact form'; else ( is_page(230) && $post->post_parent ): echo 'contact form 2'; endif; ?>
Anything I’ve tried doesn’t work, can you tell me why?
Thanks
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Conditional logic depend on parent page’ is closed to new replies.