Showpost and last

Try this : $the_query = new WP_Query( array( ‘post_type’ => ‘ad’, ‘posts_per_page’ => 10, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘ad_category’, ‘field’ => ‘id’, ‘terms’ => array(‘8’) ) ) )); posts_per_page tells how many items you want to retrieve from DB orderby tells to order items by date (optional … Read more

How can I hide my section title if there is no data in custom fields?

I would first loop over $lista and generate a new array of data that only has non-empty values. Now you can check $values to ensure there is data and output your title: function opening_hours_custom_fields() { global $post; if ( $lista = genesis_get_custom_field( ‘_happy_day’, $post->ID ) ) { $values = array(); foreach ( $lista as $value … Read more