Exemple #1
0
function uni_search_form($form)
{
    $data = getListCategory('news');
    $list = '';
    if ($data) {
        $list = '<ul id="searchAjax" class="dropdown-menu">';
        foreach ($data as $val) {
            $list .= '<li><span data-key="' . $val->slug . '">' . $val->name . '</span></li>';
        }
        $list .= '</ul>';
    }
    $keyword = '';
    if (isset($_GET['keyword'])) {
        $keyword = $_GET['keyword'];
    }
    $form = '
	<form class="navbar-form navbar-left form-inline" method="get" id="searchform" role="search" action="' . home_url('/tim-kiem') . '">
        <div class="form-group form-group-sp">
				<input type="text" class="form-control" value="' . $keyword . '" name="keyword" id="keyword">
					' . $list . '
            <button type="submit" id="searchsubmit" value="' . esc_attr__('Search') . '" class="btn btn-default">
                <i class="fa fa-search"></i>
            </button>
		</div>
	</form>';
    return $form;
}
Exemple #2
0
          <li class="active">Tìm kiếm</li>
        </ol>
      </div>
    </div>
		<div class="row search-tablet">
<?php 
wp_reset_postdata();
$width = 178;
$height = 118;
if (wpmd_is_phone()) {
    $width = 380;
    $height = 300;
}
$keyword = $_GET['keyword'];
if (!empty($keyword)) {
    $data = getListCategory('news');
    $slug = '';
    foreach ($data as $dataSearch) {
        $format = html_entity_decode($dataSearch->name);
        if ($keyword == $format) {
            $slug = $dataSearch->slug;
        }
    }
    $category = get_category_by_slug($slug);
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $args = array('post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'date', 'post_type' => 'post');
    if (!empty($slug) && !empty($category)) {
        // tim theo danh muc
        $args['category_name'] = $slug;
    } else {
        // tim tong the.
Exemple #3
0
<?php

$liste_categories = getListCategory();
if (isset($_POST['q'])) {
    $search = secure($_POST['q']);
} else {
    header('Location: ./');
}
$results = search($search);
Exemple #4
0
<div class="category-menu-left">
<?php 
global $language;
?>
<h2><?php 
echo $language == 'vi' ? 'Danh mục' : 'Categories';
?>
<span></span></h2>
<ul class="menu-left mCustomScrollbar">
<?php 
$parentId = get_category_by_slug('unideal');
$data = getListCategory('magazine-online');
?>
	<li class="high color-item-<?php 
echo $parentId->term_id;
?>
 <?php 
echo $parentId->slug;
?>
 "><span class="icon-<?php 
echo $parentId->term_id;
?>
"></span><a href="<?php 
echo get_term_link($parentId);
?>
"><var><?php 
echo $parentId->name;
?>
</var></a></li>
	<li class="page-24h high">
		<a href="<?php