• Resolved berttervoert

    (@berttervoert)


    I have created a pod named gedichten which has the following added fields:
    strofe
    datum
    On my homepage I want to show the 3 latest gedichten, each as a block containing the title, strofe and a read more link. After searching online a found some suggestions, but they only use the standard WP fields like title and thumbnail. It’s using ‘new WP_query’ to get the data. My question is: is it possible to get the content of the strofe field this way or do I have to go about it in another direction?

    The code I use is:
    $wdtv_query = new WP_Query (array(
    ‘post_type’ => ‘Gedichten’,
    ‘numberposts’ => 3,
    ‘post_status’ => ‘publish’,
    ‘order_by’ => array( ‘title’ => DESC ),
    ));
    if ( $wdtv_query -> have_posts() ) { ?>

    while ( $wdtv_query -> have_posts() ) :
    $wdtv_query -> the_post(); ?>


    endwhile;

    I use the_title() to get the title of the pod and get_post_permalink() to create a link to the full gedicht. Is it possible to get the value of the field ‘strofe’ this way or should I use the $wdtv_pods = pods( ‘gedichten’, params) method instead?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘show most recent entries of pod’ is closed to new replies.