-1, 'orderby' => 'date', 'order' => 'ASC', 'post_type' => 'product' ); $posts_array = get_posts( $args );*/ $html = '
'; $chiamata1="CALL IPER_MA_PRODUCT_LIST()"; $products=callDBStored($chiamata1); foreach ($products as $product) {//aggiungo l'order priority $product->META_WP_ID; $product->ORDER_PRIORITY=get_post_meta($product->META_WP_ID, 'order_priority', true); } usort($products, function($a, $b) {//riordino l'array in base alla priorita' associata in wp return $a->ORDER_PRIORITY - $b->ORDER_PRIORITY; }); global $wpdb; /*if(!empty($rateplans)){ foreach($rateplans as $single){ $single->META_WP_ID; get_post($single->META_WP_ID); } }*/ if(!empty($products)){ //calcola larghezza colonne $p_number = count($products); ( $p_number & 1 ) ? $num='dispari' : $num='pari' ; if($num='dispari'){ $col_size = 'col-md-4';} else { $col_size = 'col-md-3'; } foreach($products as $product){ $post = get_post($product->META_WP_ID); $idRatePlan = $product->idRATEPLAN; //per ogni prodotto prendo il contenuto di wordpress del rateplan più economico $most_economic_rateplan = get_post($product->RATEPLAN_META_WP_ID); $most_economic_rateplan_content = $most_economic_rateplan->post_content; $most_economic_rateplan_content=apply_filters('the_content',$most_economic_rateplan_content); //stampo gli accessori del rateplan piu economico associato al prodotto /* $accessory_call=$wpdb->prepare("CALL IPER_MA_ACCESSORY_LIST(%d , %d)", $idRatePlan , 0); $rp_accessories=callDBStored($accessory_call); if(!empty($rp_accessories)) { foreach ($rp_accessories as $accessory) { $nomeAccessorio = $accessory->AccessoryName; $li_nomeAccessorio = '
  • ' . $nomeAccessorio . '
  • '; } }*/ $active = get_post_meta($post->ID, 'publish_in_frontpage', true); if($active == 1){ $class = 'active'; }else{ $class = ''; } $excerpt=$post->post_excerpt; $excerpt=apply_filters('the_content',$excerpt); if(get_post_meta($post->ID, 'iper_product_testimonial_learnmore_link',true) != ''){ $learnmore_link = get_post_meta($post->ID, 'iper_product_testimonial_learnmore_link',true); } else { $learnmore_link = get_permalink($post->ID);} /*
    $'.$product->Price.'
    with '.get_post_meta($post->ID, 'Rateplan_selected',true).' plan
    */ $html .= ' '; } } /* foreach($posts_array as $post){ $active = get_post_meta($post->ID, 'publish_in_frontpage', true); if($active == 1){ $class = 'active'; }else{ $class = ''; } $html .= '
    '.$post->post_title.'
    Learn More
    $29.95
    with monthly plan
    • Pendant*
    • Bracelet*
    *Colors may vary
    Select
    '; }*/ $html .='
    '; return $html; } add_shortcode('product_medical_list', 'product_medical_list_shortcode'); function half_page_shortcode($atts, $content = null) { return '
    '.$content."
    "; } add_shortcode('half_page', 'half_page_shortcode'); function container_shortcode($atts, $content = null) { return '
    '.do_shortcode($content)."
    "; } add_shortcode('container', 'container_shortcode'); function large_col_text_shortcode($atts, $content = null) { return '
    '.$content."
    "; } add_shortcode('large_col_text', 'large_col_text_shortcode'); function small_col_img_shortcode($atts, $content = null) { return '
    '.$content."
    "; } add_shortcode('small_col_img', 'small_col_img_shortcode'); function add_bullet_shortcode($atts, $content = null) { return '
  • '.$content.'
  • '; } add_shortcode('bullet', 'add_bullet_shortcode'); function add_bullets_shortcode($atts, $content = null) { return '
    '; } add_shortcode('bullets', 'add_bullets_shortcode'); function add_plan_price_shortcode($atts, $content = null) { return '
    '.$content.'
    '; } add_shortcode('plan_price', 'add_plan_price_shortcode'); function add_plan_paymentype_shortcode($atts, $content = null) { return '
    '.$content.'
    '; } add_shortcode('payment_plan', 'add_plan_paymentype_shortcode'); function get_referral (){ $referralhtml = "

    Almost Done – Finish Signing Up

    Get $25 Here"; if(isset($_COOKIE['ConfirmationPageText']) && $_COOKIE['ConfirmationPageText'] == "referral") { return $referralhtml; global $referralhtml; }else { return null; } } add_shortcode('ref', 'get_referral'); /*
    $'.$product->Price.'
    with '.get_post_meta($post->ID, 'Rateplan_selected',true).' plan
    *Colors may vary
    */ ?>