Create / Close Div in Array [closed]

You don’t need to count or do all the stuff to determine the last element. Check if the result of the function is valid, output the DIV and then inside that run a loop: <?php // Get the terms $terms = get_the_terms( $post->ID, ‘people’ ); // Check if there’s any results, and there’s no error. … Read more

WP_Error on attribute + term insert

Try to reregister taxonomies $args = array( ‘name’ => “Color”, ‘slug’ => “color”, ‘order_by’ => “menu_order”, ‘has_archives’ => “”, ); wc_create_attribute($args); WC_Post_Types::register_taxonomies(); $add = wp_insert_term( “Blue”, ‘pa_color’, array( ‘slug’ => “blue” ) ); print_r($add);

WordPress loop: Show only a Custom Post Type Taxononmy TERM

I found the solution by myself, I leave it here in case someone is interested: <?php $args = array( ‘post_type’ => ‘agrupados’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘pedidos’, ‘field’ => ‘slug’, ‘terms’ => ‘ferrol’, ), ),); $the_query_slide = new WP_Query( $args ); if ( $the_query_slide->have_posts() ) {while ( $the_query_slide->have_posts() ) {$the_query_slide->the_post();?> <?php /* variables … Read more