Support

Account

Home Forums General Issues Loop ALL fields within sidebar Reply To: Loop ALL fields within sidebar

  • You need to do a query to get the posts http://codex.wordpress.org/Class_Reference/WP_Query and loop through the results

    
    $args = array(
      'post_type' => 'post', // or your post type
      'posts_per_page' => -1, // get them all
      'meta_query' => array(
        array(
          'key' => 'logo',
          'value' => '',
          'compare' => '!='
        )
      )
    );
    $query = new WP_Query($args);
    if ($query->have_posts()) {
      global $post;
      while ($query->have_posts()) {
        $query->the_post();
        // code to display fields from each post
        // same as done on a single post
      }
      wp_reset_postdata();
    }