@layout('parts.layout') @php /** * Template Name:列表 || 产品中心 */ @endphp {{-- 单页-页 --}} @php # 页面数据 $pageid = get_the_ID(); $pageField = $product_field = $product_fieldx2 = get_fields($pageid); $product_id = 144; $navHeight = true; $scriptForm = true; $productExternalUrlStatus = false; $param = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING)?:[]; $isAjax = false; if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') { $isAjax = true; } $isPjax = false; if (isset($_SERVER['HTTP_X_PJAX']) && strtolower($_SERVER['HTTP_X_PJAX']) === 'true') { $isPjax = true; } $isPjaxNoAction = ($isAjax || $isPjax) ? true : false; $isPjaxNoAction = true; # Cookie保留页面链接-ON $current_url = home_url(add_query_arg(array(), $wp->request)); if (is_front_page()) { $current_url = home_url('/'); } $existing_cookie = isset($_COOKIE['pageurl']) ? $_COOKIE['pageurl'] : ''; $url_array = $existing_cookie ? explode("\n", $existing_cookie) : array(); $url_array = array_filter($url_array, function($item) { return !empty(trim($item)); }); $url_array = array_filter($url_array, function($url) use ($current_url) { return trim($url) !== trim($current_url); }); $url_array = array_values($url_array); if (!in_array($current_url, $url_array)) { array_unshift($url_array, $current_url); } if (count($url_array) > 10) { $url_array = array_slice($url_array, 0, 10); } $new_cookie_value = implode("\n", $url_array); setcookie( 'pageurl', $new_cookie_value, time() + (1 * 24 * 60 * 60), '/', $_SERVER['HTTP_HOST'], is_ssl(), true ); # Cookie保留页面链接-END @endphp @php $modelBanner = true; @endphp @section('banner') @endsection @section('main') @php $cs_categories = get_categories(); if (!empty($cs_categories)) { $classid = $cs_categories[0]->term_id; } else { $classid = 10; } $classid = 10; $showLdjsonData = get_all_articles_by_category($classid); @endphp {{-- 产品列表1 --}}
@php $cs_categories = get_categories( array( 'search' => get_the_title(), // 搜索名称或描述包含"cs"的分类 'orderby' => 'name', // 按名称排序 'order' => 'ASC', // 升序 'hide_empty' => true, // 显示包含0篇文章的分类(默认隐藏) 'taxonomy' => 'category' // 指定为文章分类(若需其他 taxonomies,如标签,改为'tag') ) ); if (!empty($cs_categories)) { $classid = $cs_categories[0]->term_id; } else { $classid = 10; } # 产品条件 $pro_filter_model = $product_field['category']; $pro_where = array(); foreach ($pro_filter_model['list']?:[] as $key => $value) { $filter_name = strtolower(trim($value['name'])); $filter = $param[$filter_name] ? explode(",", $param[$filter_name]) : array(); if ($filter && is_array($filter) && count($filter)>0) { $pro_where[] = array( 'taxonomy' => 'post_tag', 'field' => 'term_id', 'terms' => $filter, 'operator' => 'IN', ); } } $args_where = array(); $args_query = array(); if ($pro_where && is_array($pro_where) && count($pro_where)>0 ) { $args_query = array('relation' => 'AND'); foreach ($pro_where?:[] as $key => $value) { $args_query[] = $value; } } $args_where['tax_query'] = $args_query; $showData = getShowData($classid, 9999, false, $args_where, $filter); $showCount = count($showData); @endphp @php $modelName = 'category'; $model = $product_field[$modelName]; @endphp @if($model['status'] || true)
{{ $model_title }}

{{ nl2br($model['title']) }}

@if( isset($model['describe']) && $model['describe'] )

{{ nl2br($model['describe']) }}

@endif @php $cateData = getCateData($product_id); @endphp

{{ get_the_Title() }}

    @php $forData = $cateData; $forData = is_object($forData) ? $forData : ( is_array($forData) ? $forData : array()); @endphp @foreach ($forData as $key => $value ) @if($key < 5)
  • {{ $value['title'] }}
  • @endif @endforeach

Filter {{ $webTitle }}

Filter {{ $webTitle }}

    @php $forData = $model['list']; $forData = is_object($forData) ? $forData : ( is_array($forData) ? $forData : array()); @endphp @foreach ($forData as $key => $value ) @php $filter_name = strtolower(trim($value['name'])); $filter = $param[$filter_name] ? explode(",", $param[$filter_name]) : array(); @endphp
  • {{ $value['name'] }}

      @php $tags_array = get_tag_names_by_ids($value['tags']); $forDataTwo = $tags_array; $forDataTwo = is_object($forDataTwo) ? $forDataTwo : ( is_array($forDataTwo) ? $forDataTwo : array()); @endphp @foreach ($forDataTwo as $keyTwo => $valueTwo )
    • @endforeach
  • @endforeach

{{ $showCount }} products

@endif
@if($pageid != 178) {{-- 产品列表2 --}} @php $modelName = 'model1'; $model = $product_field[$modelName]; @endphp @if($model['status'])

{{ nl2br($model['title']) }}

{{ nl2br($model['text']) }}

{{ $webTitle }}

Play full video

@endif @php $modelName = 'model2'; $model = $product_field[$modelName]; @endphp @if($model['status'])
{{-- Postless Purity Terpene Integrity --}}
    @php $forData = $model['list']; $forData = is_object($forData) ? $forData : ( is_array($forData) ? $forData : array()); @endphp @foreach ($forData as $key => $value )
  • {{ nl2br($value['title']) }}

    {{ nl2br($value['text']) }}

  • @endforeach
@php $forData = $model['list']; $forData = is_object($forData) ? $forData : ( is_array($forData) ? $forData : array()); @endphp @foreach ($forData as $key => $value )

{{ nl2br($value['title']) }}

{{ nl2br($value['text']) }}

@endforeach
    @endif {{-- 产品列表4 --}} @php $modelName = 'model3'; $model = $product_field[$modelName]; @endphp @if($model['status'])

    {{ nl2br($model['title']) }}

    {{ nl2br($model['text']) }}

    {{-- pc端 --}} {{-- 移动端 --}}
    @endif {{-- 产品列表5 --}} @php $modelName = 'model4'; $model = $product_field[$modelName]; @endphp @if($model['status'])

    {{ nl2br($model['title']) }}

      @php $cateData = getCateData($product_id); $forData = $cateData; $forData = is_object($forData) ? $forData : ( is_array($forData) ? $forData : array()); @endphp @foreach ($forData as $key => $value ) @php $valueData = get_fields($value['id']); @endphp @if($value['id'] != $pageid && $key <4)
    • {{ $value['title'] }}

      {{ nl2br($valueData['text']) }}

    • @endif @endforeach
    @endif @endif {{-- 产品列表6 --}} @php $modelName = 'model5'; $model = $product_field[$modelName]; @endphp @if($model['status']) @include('parts.module.public_contact_form') @endif {{-- 产品列表7 --}} @php $modelName = 'model6'; $model = $product_field[$modelName]; @endphp @if($model['status'])
    @php $forData = $model['list']; $forData = is_object($forData) ? $forData : ( is_array($forData) ? $forData : array()); @endphp @foreach ($forData as $key => $value ) @if($key==0)

    {{ nl2br($value['title']) }}

    @php if (false) { $value['text'] = htmlspecialchars_decode($value['text']); $value['text'] = str_replace("\n", '

    ', $value['text']); $value['text'] = str_replace("

    ", '
    ', $value['text']); $pattern = '/]*>\s*<\/p>/i'; $value['text'] = preg_replace($pattern, '
    ', $value['text']); }else{ $value['text'] = htmlspecialchars_decode($value['text']); $pattern = '/]*>\s*<\/p>/i'; $value['text'] = preg_replace($pattern, '
    ', $value['text']); } @endphp

    {{ ($value['text']) }}

    @endif @endforeach
      @php $forData = $model['list']; $forData = is_object($forData) ? $forData : ( is_array($forData) ? $forData : array()); @endphp @foreach ($forData as $key => $value ) @if($key!=0)
    • {{ nl2br($value['title']) }}

      {{ str_replace("\n", '

      ', $value['text']) }}

    • @endif @endforeach
    @if($model['btn_name'])
    {{ $model['btn_name'] }}
    {{ $webTitle }}
    @endif
    @endif
    @endsection @section('scripts') @endsection