I have used pods as an extension of the wordpress pages in order to display three ‘featured item’ boxes on the home page, the first of these boxes will also be used on the rest of the site’s pages. I can successfully call a certain pages entries into the custom fields using
<?php $where = array('limit'=>-1); $page = new Pod('page', $where); $page_array = array(); while ( $page->fetchRecord() ) : $featuredImg1 = $page->get_field('featured_1_image.guid'); $featuredText1 = $page->get_field('featured_1_label'); $featuredLink1 = $page->get_field('featured_1_link'); $page_array = array ('src' => $featuredImg1, 'featured_1_label' => $featuredText1, 'featured_1_link' => $featuredLink1); endwhile; ?>
<?php $page = $page_array; ?>
in my page.php file but I don’t want to have to specify a specific page, I would like to call the current page’s entries dynamically but can’t seem to figure out how to make it work properly.
- The topic ‘Displaying a page's custom fields’ is closed to new replies.