本文整理汇总了PHP中the_search_query函数的典型用法代码示例。如果您正苦于以下问题:PHP the_search_query函数的具体用法?PHP the_search_query怎么用?PHP the_search_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_search_query函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: description
function description()
{
if (is_home() || is_front_page()) {
echo trim(of_get_option('site_description'));
} elseif (is_category()) {
$description = strip_tags(category_description());
echo trim($description);
} elseif (is_single()) {
if (get_the_excerpt()) {
echo get_the_excerpt();
} else {
global $post;
$description = trim(str_replace(array("\r\n", "\r", "\n", " ", " "), " ", str_replace("\"", "'", strip_tags($post->post_content))));
echo mb_substr($description, 0, 220, 'utf-8');
}
} elseif (is_search()) {
echo '“';
the_search_query();
echo '”为您找到结果 ';
global $wp_query;
echo $wp_query->found_posts;
echo ' 个';
} elseif (is_tag()) {
$description = strip_tags(tag_description());
echo trim($description);
} else {
$description = strip_tags(term_description());
echo trim($description);
}
}
开发者ID:carpliyz,项目名称:9IPHP,代码行数:30,代码来源:header.php
示例2: widget
function widget($args, $instance)
{
?>
<div class="sidebar-section search">
<form class="cf searchform" method="get" action="<?php
echo esc_url(home_url('/'));
?>
">
<div>
<label class="assistive-text" for="s"><?php
_e('Search for:', OP_SN);
?>
</label>
<div class="search-text-input"><input type="text" value="<?php
the_search_query();
?>
" name="s" id="s" /></div>
<input type="submit" id="searchsubmit" value="<?php
esc_attr_e('Search', OP_SN);
?>
" />
</div>
</form>
</div>
<?php
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:26,代码来源:op_SidebarSearchWidget.php
示例3: the_breadcrumb
function the_breadcrumb()
{
echo '<div class="e-breadcrumbs">';
echo '<a href="';
echo get_option('home');
echo '">';
bloginfo('name');
echo "</a>";
if (is_category() || is_single()) {
echo " » ";
the_category(' • ');
if (is_single()) {
echo " » ";
the_title();
}
} elseif (is_page()) {
echo " » ";
echo the_title();
} elseif (is_search()) {
echo " » Search Results for... ";
echo '"<em>';
echo the_search_query();
echo '</em>"';
}
echo '</div>';
}
开发者ID:aIbarrab,项目名称:cbrclub,代码行数:26,代码来源:breadcrumbs.php
示例4: widget
function widget($args, $instance)
{
extract($args);
$categories = get_categories();
echo $before_widget;
?>
<div class="widget">
<h4><?php
echo apply_filters('widget_title', $instance['heading']);
?>
</h4>
<form action="<?php
echo esc_url(home_url('/'));
?>
" method="get">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="s" value="<?php
the_search_query();
?>
">
<span class="input-group-btn">
<button class="btn" type="submit"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
</div>
<?php
echo $after_widget;
}
开发者ID:juhando,项目名称:zen,代码行数:30,代码来源:search.php
示例5: widget
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
echo $before_widget;
$getimage = $instance['fotos_search_bg'];
$getsearchbtn = $instance['fotos_search_btn'];
$bgimage = $getimage ? sprintf('style="background:url(\'%s\') no-repeat;"', $getimage) : false;
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
printf('<div class="fotos-custom-search-widget" %s>', $bgimage);
?>
<form action="/" method="get" class="fotos-custom-search-form">
<fieldset>
<input type="text" name="s" id="search" placeholder="search" value="<?php
the_search_query();
?>
" />
<input type="image" alt="Search" src="<?php
echo $getsearchbtn;
?>
" />
</fieldset>
</form>
<?php
printf('</div>');
echo $after_widget;
}
开发者ID:steffancarrington,项目名称:fotos,代码行数:28,代码来源:custom-search.php
示例6: search_widget
function search_widget()
{
?>
<li id="search_widget" class="widget widget_search">
<?php
if (!is_dynamic_sidebar()) {
?>
<h2><?php
_e('Etc', 'depo-masthead');
?>
</h2><?php
}
?>
<form method="get" id="searchform" action="<?php
bloginfo('url');
?>
/">
<label class="hidden" for="s"><?php
_e('Search for:');
?>
</label>
<div><input type="text" value="<?php
the_search_query();
?>
" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form></li><?php
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:29,代码来源:functions.php
示例7: widget
function widget($args, $instance)
{
extract($args);
echo $before_widget;
$search_type = yit_get_option('search_type');
if (!is_shop_installed() && $search_type == 'product') {
$search_type = 'post';
}
?>
<form action="<?php
echo home_url('/');
?>
" method="get" class="search_mini">
<input type="text" name="s" id="search_mini" value="<?php
the_search_query();
?>
" placeholder="<?php
if (is_shop_installed()) {
_e('search for products', 'yit');
} else {
_e('search for...', 'yit');
}
?>
" />
<input type="hidden" name="post_type" value="<?php
echo $search_type;
?>
" />
<input type="submit" value="Search" id="mini-search-submit" />
</form>
<?php
echo $after_widget;
}
开发者ID:gloomyghost,项目名称:Tip-Top-Art,代码行数:35,代码来源:search_mini.php
示例8: widget
function widget($args, $instance)
{
extract($args);
echo $before_widget;
$search_type = yit_get_option('search_type');
if (!is_shop_installed() && $search_type == 'product') {
$search_type = 'post';
}
?>
<a href="#" class="search_mini_button"></a>
<div class="search_mini_content">
<span class="dropdown_arrow"></span>
<?php
if (defined('YITH_WCAS')) {
?>
<?php
echo do_shortcode('[yith_woocommerce_ajax_search]');
?>
<?php
} else {
?>
<form action="<?php
echo home_url('/');
?>
" method="get" class="search_mini">
<input type="text" name="s" id="search_mini" value="<?php
the_search_query();
?>
" placeholder="<?php
if (is_shop_installed()) {
_e('search for products', 'yit');
} else {
_e('search for...', 'yit');
}
?>
" /><input type="submit" value="" id="mini-search-submit" />
<input type="hidden" name="post_type" value="<?php
echo $search_type;
?>
" />
</form>
<?php
}
?>
</div>
<?php
echo $after_widget;
}
开发者ID:jayeshnair,项目名称:ctp,代码行数:50,代码来源:search_mini.php
示例9: widget
function widget($args, $instance)
{
extract($args);
echo $before_widget;
$search_for_product = apply_filters('yit_search_for_prod_label', __('search for products', 'yit'));
$search_for = apply_filters('yit_searc_for_prod_label', __('search for...', 'yit'));
$placeholder = is_shop_installed() ? $search_for_product : $search_for;
if (defined('YITH_WCAS')) {
?>
<?php
echo do_shortcode('[yith_woocommerce_ajax_search]');
?>
<?php
} else {
$search_type = yit_get_option('search_type');
if (!is_shop_installed() && $search_type == 'product') {
$search_type = 'post';
}
?>
<form action="<?php
echo home_url('/');
?>
" method="get" class="search_mini">
<input type="text" name="s" id="search_mini" value="<?php
the_search_query();
?>
" placeholder="<?php
echo $placeholder;
?>
" />
<input type="hidden" name="post_type" value="<?php
echo $search_type;
?>
" />
<input type="submit" value="<?php
_e('Search', 'yit');
?>
" id="mini-search-submit" />
</form>
<?php
}
echo $after_widget;
}
开发者ID:VitaliyProdan,项目名称:wp_shop,代码行数:46,代码来源:search_mini.php
示例10: the_qa_search_form
function the_qa_search_form()
{
?>
<form method="get" action="<?php
echo qa_get_url('archive');
?>
">
<input type="text" name="s" value="<?php
the_search_query();
?>
" />
<button><?php
_e('Search', QA_TEXTDOMAIN);
?>
</button>
</form>
<?php
}
开发者ID:rgrp,项目名称:wordpress-qa,代码行数:18,代码来源:template-tags.php
示例11: rd_search
function rd_search($atts, $content)
{
extract(shortcode_atts(array('t_color' => '', 'bg_color' => '', 'b_color' => '', 'h_color' => '', 'placeholder' => 'Search', 'margin_top' => '0', 'margin_bottom' => '0', 'animation' => '', 'width' => '', 'radius' => '0'), $atts));
ob_start();
$id = RandomString(20);
global $rd_data;
if ($t_color == '') {
$t_color = $rd_data['rd_content_text_color'];
}
if ($b_color == '') {
$b_color = $rd_data['rd_content_border_color'];
}
if ($bg_color == '') {
$bg_color = $rd_data['rd_content_bg_color'];
}
if ($h_color == '') {
$h_color = $rd_data['rd_content_hover_color'];
}
if ($placeholder == '') {
$placeholder = "Search";
}
if ($width !== '') {
echo '<style>#rd_' . $id . ' {width:' . $width . 'px;}</style>';
}
echo '<style>#rd_' . $id . ' {margin-top:' . $margin_top . 'px; margin-bottom:' . $margin_bottom . 'px;}#rd_' . $id . ' #search input[type=text]{background:' . $bg_color . '; border:1px solid ' . $b_color . '; color:' . $t_color . '; border-radius:' . $radius . 'px;}#rd_' . $id . ' #search input[type=submit]{color:' . $t_color . '}#rd_' . $id . ' #search input[type=submit]:hover{color:' . $h_color . '}</style>';
echo '<div class="rd_search_sc ' . $animation . '" id="rd_' . $id . '"><div id="search">';
?>
<form method="get" action="<?php
echo esc_url(home_url(""));
?>
"><input type="text" name="s" placeholder="<?php
echo esc_attr($placeholder);
?>
" class="search" value="<?php
echo the_search_query();
?>
"/><input type="submit" id="searchsubmit" value=""></form>
</div></div> <?php
$output_string = ob_get_contents();
ob_end_clean();
return $output_string;
}
开发者ID:axelander95,项目名称:wsguiavirtualpichincha,代码行数:43,代码来源:rd_search.php
示例12: wootique_header_search
function wootique_header_search()
{
global $woo_options;
?>
<div id="search-top">
<form role="search" method="get" id="searchform" class="searchform" action="<?php
echo home_url();
?>
">
<label class="screen-reader-text" for="s"><?php
_e('Search for:', 'woothemes');
?>
</label>
<input type="text" value="<?php
the_search_query();
?>
" name="s" id="s" class="field s" placeholder="<?php
_e('Search for products', 'woothemes');
?>
" />
<input type="image" class="submit btn" name="submit" value="<?php
_e('Search', 'woothemes');
?>
" src="<?php
echo get_template_directory_uri();
?>
/images/ico-search.png">
<?php
if ($woo_options['woo_header_search_scope'] == 'products') {
echo '<input type="hidden" name="post_type" value="product" />';
} else {
echo '<input type="hidden" name="post_type" value="post" />';
}
?>
</form>
<div class="fix"></div>
</div><!-- /.search-top -->
<?php
}
开发者ID:ridwanahmedkhan,项目名称:E-Commerce_Wordpress,代码行数:42,代码来源:theme-woocommerce.php
示例13: widget_chaostheory_search
function widget_chaostheory_search($args)
{
extract($args);
if (empty($title)) {
$title = __('Search', 'chaostheory');
}
?>
<?php
echo $before_widget;
?>
<?php
echo $before_title;
?>
<label for="s"><?php
echo $title;
?>
</label><?php
echo $after_title;
?>
<form id="searchform" method="get" action="<?php
echo home_url();
?>
">
<div>
<input id="s" name="s" type="text" value="<?php
the_search_query();
?>
" size="10" />
<input id="searchsubmit" type="submit" value="<?php
esc_attr_e('Find »', 'chaostheory');
?>
" />
</div>
</form>
<?php
echo $after_widget;
?>
<?php
}
开发者ID:darrylivan,项目名称:caraccidentlawyerflagstaff.com,代码行数:41,代码来源:widgets.php
示例14: display
function display($args)
{
extract($args);
echo $before_widget;
?>
<form method="get" id="searchform" action="<?php
bloginfo('home');
?>
/">
<input class="text" type="text" value="<?php
the_search_query();
?>
" name="s" id="s" />
<input class="button-secondary" type="submit" id="searchsubmit" value="<?php
_e('Search', 'guangzhou');
?>
" />
</form>
<?php
echo $after_widget;
}
开发者ID:billerby,项目名称:Surdeg,代码行数:21,代码来源:search.php
示例15: section_template
function section_template() {
if(is_category() || is_archive() || is_search()):
?>
<div class="current_posts_info">
<?php if(is_search()):?>
<?php _e("Search results for ", 'pagelines');?>
<strong>"<?php the_search_query();?>"</strong>
<?php elseif(is_category()):?>
<?php _e("Currently viewing the category: ", 'pagelines');?>
<strong>"<?php single_cat_title();?>"</strong>
<?php elseif(is_tag()):?>
<?php _e("Currently viewing the tag: ", 'pagelines');?>
<strong>"<?php single_tag_title(''); ?>"</strong>
<?php elseif(is_archive()):?>
<?php if (is_author()) {
global $author;
global $author_name;
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
_e('Posts by:', 'pagelines'); ?>
<strong><?php echo $curauth->display_name; ?></strong>
<?php } elseif (is_day()) { ?>
<?php _e('From the daily archives:', 'pagelines'); ?>
<strong><?php the_time('l, F j, Y'); ?></strong>
<?php } elseif (is_month()) { ?>
<?php _e('From the monthly archives:', 'pagelines'); ?>
<strong><?php the_time('F Y'); ?></strong>
<?php } elseif (is_year()) { ?>
<?php _e('From the yearly archives:', 'pagelines'); ?>
<strong><?php the_time('Y'); ?></strong>
<?php } else {?>
<?php _e("Viewing archives for ", 'pagelines');?>
<strong>"<?php the_date();?>"</strong>
<?php } ?>
<?php endif;?>
</div>
<?php endif;
}
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:40,代码来源:section.postsinfo.php
示例16: widget
/** @see WP_Widget::widget */
function widget( $args, $instance ) {
extract($args);
$title = $instance['title'];
$title = apply_filters('widget_title', $title, $instance, $this->id_base);
echo $before_widget;
if ($title) echo $before_title . $title . $after_title;
?>
<form role="search" method="get" id="searchform" action="<?php echo home_url(); ?>">
<div>
<label class="screen-reader-text" for="s"><?php _e('Search for:', 'jigoshop'); ?></label>
<input type="text" value="<?php the_search_query(); ?>" name="s" id="s" placeholder="<?php _e('Search for products', 'jigoshop'); ?>" />
<input type="submit" id="searchsubmit" value="<?php _e('Search', 'jigoshop'); ?>" />
<input type="hidden" name="post_type" value="product" />
</div>
</form>
<?php
echo $after_widget;
}
开发者ID:rszczypka,项目名称:jigoshop,代码行数:24,代码来源:product_search.php
示例17: the_breadcrumb
function the_breadcrumb()
{
echo '<a href="';
echo home_url();
echo '" rel="nofollow">Home';
echo "</a>";
if (is_category() || is_single()) {
echo " » ";
the_category(' • ');
if (is_single()) {
echo " » ";
the_title();
}
} elseif (is_page()) {
echo " » ";
echo the_title();
} elseif (is_search()) {
echo " » Search Results for... ";
echo '"<em>';
echo the_search_query();
echo '</em>"';
}
}
开发者ID:jleontidis,项目名称:sinthesis,代码行数:23,代码来源:functions.php
示例18: bf_widget_search
/**
* bf_widget_search() - Search Widget Function
*
* Replaces the default search widget.
*
* @since 0.5.2
* @param mixed $args Widget options
*/
function bf_widget_search($args)
{
extract($args, EXTR_SKIP);
echo $before_widget;
echo $before_title . 'Search' . $after_title;
?>
<form method="get" id="widgetsearch" action="<?php
bloginfo('url');
?>
/">
<input type="text" value="<?php
the_search_query();
?>
" name="s"
id="s" size="20" onfocus="this.value=''" class="text" />
<input type="submit" id="searchsubmit" class="submit" value="<?php
_e('Search', 'buffet');
?>
" />
</form>
<?php
echo $after_widget;
}
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:31,代码来源:widgets.php
示例19: _e
_e('Not Found', 'plaintxtblog');
?>
</h2>
<div class="entry-content">
<p><?php
_e('Apologies, but we were unable to find what you were looking for. Perhaps the search box will help.', 'plaintxtblog');
?>
</p>
</div>
</div><!-- #post-0 .post -->
<form id="error404-searchform" method="get" action="<?php
bloginfo('home');
?>
">
<div>
<input id="error404-s" name="s" type="text" value="<?php
the_search_query();
?>
" size="40" />
<input id="error404-searchsubmit" name="searchsubmit" type="submit" value="<?php
_e('Search', 'plaintxtblog');
?>
" />
</div>
</form>
</div><!-- #content .hfeed -->
</div><!-- #container -->
<?php
get_sidebar();
get_footer();
开发者ID:slaFFik,项目名称:l10n-ru,代码行数:31,代码来源:404.php
示例20: nggallery_manage_gallery_main
//.........这里部分代码省略.........
jQuery("#" + windowId + ' .dialog-cancel').click(function() { jQuery( "#" + windowId ).dialog("close"); });
}
function showAddGallery() {
jQuery( "#addGallery").dialog({
width: 640,
resizable : false,
modal: true,
title: '<?php
echo esc_js(__('Add new gallery', 'nggallery'));
?>
'
});
jQuery("#addGallery .dialog-cancel").click(function() { jQuery( "#addGallery" ).dialog("close"); });
}
//-->
</script>
<div class="wrap">
<?php
screen_icon('nextgen-gallery');
?>
<h2><?php
echo _n('Gallery', 'Galleries', 2, 'nggallery');
?>
</h2>
<form class="search-form" action="" method="get">
<p class="search-box">
<label class="hidden" for="media-search-input"><?php
_e('Search Images', 'nggallery');
?>
:</label>
<input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" />
<input type="text" id="media-search-input" name="s" value="<?php
the_search_query();
?>
" />
<input type="submit" value="<?php
_e('Search Images', 'nggallery');
?>
" class="button" />
</p>
</form>
<form id="editgalleries" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&paged=' . $_GET['paged'];
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_bulkgallery');
?>
<input type="hidden" name="page" value="manage-galleries" />
<div class="tablenav">
<div class="alignleft actions">
<?php
if (function_exists('json_encode')) {
?>
<select name="bulkaction" id="bulkaction">
<option value="no_action" ><?php
_e("Bulk actions", 'nggallery');
?>
</option>
<option value="delete_gallery" ><?php
_e("Delete", 'nggallery');
?>
</option>
开发者ID:ahsaeldin,项目名称:projects,代码行数:67,代码来源:manage-galleries.php
注:本文中的the_search_query函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论