当前位置: 首页>>代码示例>>PHP>>正文


PHP td_util::generate_category_pull_down方法代码示例

本文整理汇总了PHP中td_util::generate_category_pull_down方法的典型用法代码示例。如果您正苦于以下问题:PHP td_util::generate_category_pull_down方法的具体用法?PHP td_util::generate_category_pull_down怎么用?PHP td_util::generate_category_pull_down使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在td_util的用法示例。


在下文中一共展示了td_util::generate_category_pull_down方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_query_var

        }
    }
    $buffy .= '</ul>';
    $buffy .= '<div class="clearfix"></div>';
    $buffy .= '</div>';
}
//get the `filter_by` URL ($_GET) variable
$filter_by = get_query_var('filter_by');
$td_category_big_grid_drop_down_filter_options = array(array('id' => 'latest', 'value' => $category_link, 'caption' => __td('Latest')), array('id' => 'featured', 'value' => add_query_arg('filter_by', 'featured', $category_link), 'caption' => __td('Featured posts')), array('id' => 'popular', 'value' => add_query_arg('filter_by', 'popular', $category_link), 'caption' => __td('Most popular')), array('id' => 'popular7', 'value' => add_query_arg('filter_by', 'popular7', $category_link), 'caption' => __td('7 days popular')), array('id' => 'review_high', 'value' => add_query_arg('filter_by', 'review_high', $category_link), 'caption' => __td('By review score')), array('id' => 'random_posts', 'value' => add_query_arg('filter_by', 'random_posts', $category_link), 'caption' => __td('Random')));
// is a flag to hide the 'No posts to display' message if on category page there are between 1 and 5  posts
$global_flag_to_hide_no_post_to_display = '';
//this flag is checked in the loop.php file to hide the `No posts to display` message if we have the big grid on the page and there are between 1 and 5  posts
$global_flag_to_hide_no_post_to_display = $wp_query->post_count;
//if there are post to display add also the drop down category filter
if ($td_disable_big_grid != 'yes') {
    echo $buffy;
    //create the drop-down filter on category pages
    echo td_util::generate_category_pull_down($td_category_big_grid_drop_down_filter_options, $filter_by);
    //print_r($global_flag_to_hide_no_post_to_display);
    //only show the big grid on first page
    if ($paged < 2) {
        //parameters to filter to for big grid
        $atts_for_big_grid = array('limit' => '5', 'category_id' => $cur_cat_id);
        //add the sorting option to the big_grid
        if (!empty($filter_by)) {
            $atts_for_big_grid['sort'] = $filter_by;
        }
        //show the big grid
        echo td_global_blocks::get_instance('td_block_big_grid')->render($atts_for_big_grid);
    }
}
开发者ID:vikasjain1595,项目名称:wordpresstheme,代码行数:31,代码来源:page-category-big-grid.php


注:本文中的td_util::generate_category_pull_down方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。