Example #1
0
<?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;
Example #2
0
$parentId = get_category_by_slug('giai-tri');
$args = array('category_custom_field' => 'category_order', 'orderby' => 'category_order', 'order' => 'DESC', 'parent' => $parentId->term_id, 'taxonomy' => 'category', 'hide_empty' => 0);
$categories = get_categories($args);
$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 
Example #3
0
        <div class="row">
					<?php 
if (!wpmd_is_phone()) {
    ?>
          <div class="col-md-<?php 
    echo wpmd_is_tablet() ? 3 : 2;
    ?>
 col-sm-4">
            <?php 
    get_template_part('template-small/menu');
    ?>
          </div>
					<?php 
}
?>
          <div class="col-md-6 col-sm-8">
            <?php 
get_template_part('template-small/advertisement');
?>
          </div>
          <div class="col-md-<?php 
echo wpmd_is_tablet() ? 3 : 4;
?>
 col-sm-12">
            <?php 
get_template_part('template-small/advertisement_four');
?>
          </div>
        </div>
    </div>
</section><!--end wrap-new-adv-->