2016-06-29 3 views
0

우리는 1 년 이상 웹 사이트에서 플러그인을 사용하고 있었지만 어떤 이유로 짧은 코드가 일반 텍스트로 출력되어 실제로 단축 코드 자체를 표시합니다. 단축 코드는 제품 슬라이더를 생성해야합니다.WordPress shortcode plain text로 표시

문제의 플러그인은 다음과 같습니다 WPB WooCommerce 제품 슬라이더

웹 사이트는 다음과 같습니다 https://londontopsoilcompany.co.uk/

전체 페이지는 단축 코드의 (포함) WYWYG 편집기 내에서 만들어졌다. 불행히도, 필자는 어디서 충돌이 일어나는지 식별하기 위해 플러그인을 비활성화하기 시작할 수없는 입장에 서 있습니다.

나는 모든 웹을 통해 찾고있다, 나는 그게 전부는 플러그인 witihn 포함 된 shortcodes.php 파일을 체크 아웃 않았고, 나는 거기에 볼 수 있습니다

add_shortcode('wpb-latest-product', 'wpb_wps_shortcode'); 

if(!function_exists('wpb_wps_shortcode')): 
    function wpb_wps_shortcode($atts){ 
     extract(shortcode_atts(array(
      'title' => __('Latest Products','wpb-wps'), 
     ), $atts)); 

     $return_string = '<div class="wpb_slider_area wpb_fix_cart">'; 
     $return_string .= '<h3 class="wpb_area_title">'.$title.'</h3>'; 
     $return_string .= '<div id="wpb-wps-latest" class="wpb-wps-wrapper owl-carousel '.wpb_ez_get_option("wpb_slider_type_gen_lat", "wpb_wps_style", "grid cs-style-3").'">'; 

     $args = array(
      'post_type'   => 'product', 
      'posts_per_page' => wpb_ez_get_option('wpb_num_pro', 'wpb_wps_general', 12) 
     ); 

     $loop = new WP_Query($args); 

     if ($loop->have_posts()) { 
      while ($loop->have_posts()) : $loop->the_post(); 
       global $post, $product; 
       $return_string .= '<div class="item">'; 
       $return_string .= '<figure>';   
       $return_string .= '<a href="'.get_permalink().'" class="wpb_pro_img_url">'; 
       if (has_post_thumbnail($loop->post->ID)){ 
        $return_string .= get_the_post_thumbnail($loop->post->ID, 'shop_catalog', array('class' => "wpb_pro_img")); 
       }else{ 
        $return_string .= '<img id="place_holder_thm" src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" />'; 
       } 
       $return_string .='</a>'; 
       $return_string .='<figcaption>'; 
       $return_string .='<h3 class="pro_title">'; 
       if (strlen($post->post_title) > 20) { 
        $return_string .= substr(the_title($before = '', $after = '', FALSE), 0, wpb_ez_get_option('wpb_title_mx_ch', 'wpb_wps_style', 10)) . '...'; 
       }else{ 
        $return_string .= get_the_title(); 
       } 
       $return_string .='</h3>'; 
       if($price_html = $product->get_price_html()){ 
        $return_string .='<div class="pro_price_area">'. $price_html .'</div>'; 
       } 
       $return_string .= '<div class="wpb_wps_cart_button"><a href="'.esc_url($product->add_to_cart_url()).'" rel="nofollow" data-product_id="'.esc_attr($product->id).'" data-product_sku="'.esc_attr($product->get_sku()).'" data-quantity="'.esc_attr(isset($quantity) ? $quantity : 1).'" class="button '. ($product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '') .' product_type_'.esc_attr($product->product_type).'">'.esc_html($product->add_to_cart_text()).'</a></div>'; 
       $return_string .='</figcaption>'; 
       $return_string .= '</figure>'; 
       $return_string .= '</div>'; 
      endwhile; 
     } else { 
      echo __('No products found','wpb-wps'); 
     } 
     wp_reset_postdata(); 
     $return_string .= '</div>'; 
     $return_string .= '</div>'; 
     wp_reset_query(); 
     return $return_string; 
    } 
endif; 

내가 사용 단축 코드는 [wpb-latest-product title=”Latest Product”]

입니다

다른 사람이이 문제가 발생했는지 확인하고 있습니까? 또는 이러한 문제를 진단하는 가장 좋은 단계는 무엇입니까?

또한 '시각적'탭이 아닌 '텍스트'탭에 단축 코드를 추가했지만 아무 효과가 없습니다.

답변

1

오류 데이터가 완료되지 않았기 때문에 짧은 코드 검사 만 도와 드릴 수 있습니다. 확인 this link

관련 문제