本文整理匯總了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);
}
}