L
L
lavAzza22016-03-03 15:57:23
CMS
lavAzza2, 2016-03-03 15:57:23

How to display the latest posts of custom post types of the pods plugin in wordpress on the main page?

Hello.
Created a custom post type in the PODS plugin in Wordpress.
How can I make the latest posts of this type appear on the main page of the site?
For example, how standard recent entries are displayed on the main page.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
Zhainar, 2016-03-03
@zhainar

wp-kama.ru/function/get_posts
although a direct database query might be faster.

N
nozzy, 2016-03-03
@nozzy

$params = array( 
    'orderby' => 'date DESC',     
    'limit' => 10
 ); 

$my_pod = pods( 'your_pods' )->find( $params ); 

while ( $my_pod->fetch() ) { 
    echo '<p>' . $my_pod->display( 'field_name' ) . '</p>'; 
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question