日韩伦理亚洲欧美在线一区_免费看一级大片_在线观看视频一区二区_日韩大片高清播放器大全






    請注意如果以下代碼如果無法運行,請?zhí)鎿Q代碼中所有單引號和雙引號為英文狀態(tài)下的單引號和雙引號,因為在文章中發(fā)布代碼有時候單引號和雙引號會被替換為中文狀態(tài)下的單雙引號。

    1,不需要自定義分頁的情況:

    <?php $cat = get_query_var('cat'); ?>
    <ul id="pro-list-in">
    <?php while ( have_posts() ) : the_post(); ?>
    <li>
    
    </li>
    <?php endwhile;?>
    <div class="clear"></div>
    </ul>

     

    2,需要自定義分頁的情況:

    <?php $term = get_queried_object()->slug; ?>
    <ul class="pro-list-in">
    
    <?php
    $page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
    $search_args = array(
    'post_type' => 'portfolio',
    'posts_per_page' => '6',
    'paged' =>? $page,
    'tax_query' => array(
    array(
    'taxonomy' => 'portfolio_category',
    'field' => 'slug',
    'terms' => $term )
    )
    );
    $i=1;
    query_posts($search_args);?>
    <?php while ( have_posts() ) : the_post(); ?>
    <li>
    </li>
    <?php endwhile;?>
    <div class="pagination fixed">
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
    </div><!-- end .pagination -->
    <?php wp_reset_query();? ?>
    
    </ul>

     

    3,通用調(diào)用方式:

    <?php $term = get_queried_object()->slug; ?>
    
    <ul class="pro-list-in">
    <?php
    $page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
    $search_args = array(
    'post_type' => 'portfolio',
    'posts_per_page' => '21',
    'paged' =>? $page,
    'tax_query' => array(
    array(
    'taxonomy' => 'portfolio-category',
    'field' => 'slug',
    'terms' => $term )
    )
    );
    query_posts($search_args);
    ?>
    <?php //query_posts("posts_per_page=10&post_type=post"); ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <li>
    <?php $thumb_t = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' ); $url_t = $thumb_t['0']; ?>
    <?php if ($thumb_t) : ?>
    <div class="slider-img">
    <a href="<?php echo get_permalink($post->ID) ?>" class="thumbnail" title="<?php echo $post->post_title ?>"><img src="<?php bloginfo('template_url')?>/timthumb.php?src=<?php echo $url_t ?>&amp;w=170&amp;h=170;&amp;zc=1" width="170" height="170"></a>
    </div>
    <?php else :?>
    <div class="slider-img">
    <a href="<?php echo get_permalink($post->ID) ?>" class="thumbnail" title="<?php echo $post->post_title ?>"><img src="<?php bloginfo('template_url')?>/timthumb.php?src=/images/default.png&amp;w=170&amp;h=170;&amp;zc=1" width="170" height="170"></a>
    </div>
    <?php endif; ?>
    <?php //the_excerpt(); ?>
    <div class="title"><a href="<?php echo get_permalink($post->ID) ?>" title="<?php echo $post->post_title ?>"><?php the_title(); ?></a></div>
    </li>
    <?php endwhile;?>
    <div class="clear"></div>
    <div class="pagination gdl-divider"><?php echo pagination(); ?></div>
    <?php wp_reset_query();? ?>
    </ul>

     

    4,調(diào)用自定義字段通用代碼

    <?php
    $term = get_queried_object();
    $tax = 'product_cat';
    $term_id = $term->term_id;
    ?>
    <a href="<?php the_field('banner_href', 'product_cat_'.$term_id) ?>" class="banner-href" title="links"></a>
    <?php $banner_img = get_field('banner_img', 'product_cat_'.$term_id);?>
    <img src="<?php bloginfo('template_url')?>/timthumb.php?src=<?php echo $banner_img ?>&amp;w=1920&amp;h=200;&amp;zc=1" alt="<?php echo $category->name ?>" width="100%" height="700">

     

    ? ? ? ? ? ? ? ? ? ? ? ?

    我們將在一個工作日內(nèi)聯(lián)系您

    ? ? ? ? ? ? ? ? ? ? ? ?

    免費診斷您的獨立站及產(chǎn)品搜索量,制定您的海外營銷計劃

    合水县| 中西区| 南平市| 温泉县| 贵德县| 崇阳县| 南江县| 镇巴县| 柳州市| 龙南县| 常熟市| 喜德县| 怀远县| 庆安县| 交城县| 梁河县| 塘沽区| 高州市| 昌吉市| 东丽区| 麻江县| 大埔县| 都昌县| 松江区| 丹凤县| 肇东市| 卫辉市| 淮北市| 乡城县| 定日县| 宜宾市| 西乡县| 平乐县| 阳春市| 滦平县| 上蔡县| 潜江市| 奉贤区| 甘德县| 扬中市| 常山县|