Getting the parent page id automatically
-
This code below displays a custom field of all child pages of parent page id 19:
<?php query_posts(array('post_parent' => 19, 'post_type' => 'page')); while (have_posts()) { the_post(); ?><div><a href='' rel="bookmark"><img src="<?php the_field('navigation_thumbnail') ?>" alt="<?php the_title(); ?>"/></a></div><?php } ?>
Instead of adding the id 19 I want to retreive the current id of the page automatically. Can someone help me with this? Thank You!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Getting the parent page id automatically’ is closed to new replies.