本文整理汇总了PHP中wpmd_is_phone函数的典型用法代码示例。如果您正苦于以下问题:PHP wpmd_is_phone函数的具体用法?PHP wpmd_is_phone怎么用?PHP wpmd_is_phone使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpmd_is_phone函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$cats = array();
foreach ($categories as $cat) {
$ordr = get_field('category_order', 'category_' . $cat->term_id);
$cat->order = $ordr;
$cats[] = $cat;
}
usort($cats, function ($a, $b) {
return $a->order - $b->order;
});
$width = 320;
$height = 320;
if (wpmd_is_tablet()) {
$width = 380;
$height = 380;
}
if (wpmd_is_phone()) {
$width = 767;
$height = 767;
}
if ($cats) {
?>
<div class="row entertainment">
<?php
$count = 1;
foreach ($cats as $value) {
?>
<?php
if ($value->count > 0) {
?>
<div class="col-md-12">
<div class="show-title-article">
示例2: get_template_part
<?php
get_template_part('block/top4sale');
get_template_part('block/list_category_hot');
?>
<?php
wp_reset_postdata();
$width = 320;
$height = 320;
$char = 18;
if (wpmd_is_phone() || wpmd_is_tablet()) {
$width = 360;
$height = 360;
$char = 12;
}
$args = array('post_status' => 'publish', 'post_type' => 'post', 'category_name' => 'news', 'order' => 'DESC', 'meta_key' => 'sort_by', 'orderby' => 'meta_value post_date', 'meta_query' => array(array('key' => 'hot', 'value' => true)), 'posts_per_page' => 12);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) {
?>
<ul class="row">
<?php
while ($the_query->have_posts()) {
$the_query->the_post();
$category_cat = get_the_category();
$class = '';
if ($category_cat && $category_cat[0]->slug != 'nguon-dia-oc') {
$class = 'not-real';
$char = 16;
示例3: get_search_form
<p class="worktime">с 10:00 до 21:00, Воскресение — выходной</p>
</div>
<?php
get_search_form();
?>
<!-- <input type="search" class="search-field" placeholder="Поиск по сайту"> -->
</div>
</div>
</footer>
</div>
<?php
}
?>
<?php
if (wpmd_is_phone() and $_COOKIE["front"] != "1") {
?>
<footer class="phone">
<div class="footer-wrap">
<div class="footer">
<a class="logo" href="/"><img class="retina" src="<?php
echo get_template_directory_uri();
?>
/images/logo-phone.png" alt=""></a>
<p class="site-description">школа политики<br>и бизнеса</p>
<a class="full-link" href="/?code=1">Полная версия сайта</a>
</div>
</div>
</footer>
示例4:
<?php
global $language;
?>
<section id="wrap-new-adv" class="wrap-new-adv">
<div class="container">
<div class="row">
<?php
if (!wpmd_is_phone()) {
?>
<div class="col-md-2 col-sm-4 col-xs-12">
<div class="category-menu-left">
<h2><?php
echo $language == 'en' ? 'Category' : 'Danh mục';
?>
</h2>
<ul class="menu-left">
<?php
get_template_part('block/menu_category');
?>
</ul>
</div>
</div>
<?php
}
?>
<div class="col-md-6 col-sm-8 col-xs-12">
<?php
get_template_part('block/slider');
?>
示例5: uni_search_form
function uni_search_form($form)
{
global $language;
// $parent_obj = get_category_by_slug('magazine');
// $html = '<select name="type" class="form-control">';
// $choose = ($language == 'vi')? '-- Chọn --': '-- Choose --';
// $html .= '<option value="">'.$choose.'</option>';
// if($parent_obj):
// $args = array(
// 'orderby' => 'id',
// 'order' => 'DESC',
// 'parent' => $parent_obj->term_id,
// 'taxonomy' => 'category',
// 'hide_empty' => 1 ,
// 'number' => 10,
// );
// $categories = get_categories( $args );
// if(!empty($categories)){
// foreach ($categories as $value){
// $html .= '<option value="'.$value->slug.'">'.$value->name.'</option>';
// }
// }
// endif;
// $html .= '</select>';
$keyword = $language == 'vi' ? 'Từ khóa' : 'Keyword';
$uri_home = preg_replace('/(http|https)\\:\\/\\/' . $_SERVER['SERVER_NAME'] . '/', '', WP_HOME);
$uri_home = str_replace($uri_home . '/en', '', $_SERVER['REQUEST_URI']);
$lang = '';
if (!wpmd_is_phone()) {
$lang = '<div class="language">
<a href="' . get_site_url() . '/vi' . $uri_home . '" title="Tiếng Việt" class="vi"></a>
<a href="' . get_site_url() . '/en' . $uri_home . '" title="English" class="en"></a>
</div>';
}
$form = '
<form class="navbar-form navbar-right hide-search searchform form-inline" method="get" id="searchform" role="search" action="' . home_url('/') . '">
' . $lang . '
<div class="form-group form-group-sp">
<input type="text" class="form-control" placeholder="' . $keyword . '" value="' . get_search_query() . '" name="s" id="s">
<button type="submit" id="searchsubmit" value="' . esc_attr__('Search') . '" class="btn btn-default">
<i class="fa fa-search"></i>
</button>
</div>
</form>';
return $form;
}