0

I have

<?php $args = array(
    'posts_per_page'   => 5,
    'offset'           => 0,
    'category'         => '',
    'orderby'          => 'post_date',
    'order'            => 'DESC',
    'include'          => '',
    'exclude'          => '',
    'meta_key'         => '',
    'meta_value'       => '',
    'post_type'        => 'ait-dir-item',
    'post_mime_type'   => '',
    'post_parent'      => '',
    'post_status'      => 'publish',
    'suppress_filters' => true ); 


    $myposts = get_posts( $args );
foreach ( $myposts as $post ) {
//print_r($post);

$key_1_value = get_post_meta($post->ID, '_ait-dir-item', true );

// check if the custom field has a value
if( ! empty( $key_1_value ) ) {
  Print_r( $key_1_value);
} 
    }

Emphasized Text Here

2
Contributors
1
Reply
11
Views
3 Years
Discussion Span
Last Post by diafol
0

You're using a number of user-defined functions, which really confuse the matter as you don't include them so we can see what they do. This is not your code I take it, so where did you get it?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.