Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://www.openscriptsolution.com/cms/wordpress/pods-2-0-how-to-display-pods-item-using-pods-page-and-pods-template/
- <?php
- // Get 3 records per page, ordered by name ascending,
- $params = array( 'orderby' => 'name ASC', 'limit' => 3 );
- // Maps to the new find method
- $pod_countries = pods( 'countries', $params );
- // Display it to the template
- echo $pod_countries->find( $params )->template( 'country_list' );
- // Display the pagination
- echo $pod_countries->pagination();
- ?>
- <?php
- // Get the latest variable from Pods URL
- $id = pods_url_variable('last');
- // Define the params to find the Pods Item based on the $id
- $params = array( 'where' => 'permalink = "'.$id.'"' );
- // Display it by using Pods Template
- echo pods( 'countries' )->find( $params )->template( 'country_detail' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment