forked from OpenDevelopmentMekong/opendev-wptheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-news.php
55 lines (53 loc) · 1.2 KB
/
page-news.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/*
Template Name: News archive page
*/
?>
<?php
get_header();
?>
<?php
global $wpdb, $wp_query;
$filter_by_lang = strtolower(get_localization_language_by_language_code(qtrans_getLanguage()));
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
if (SITE_NAME == "Cambodia"){
$number_latest_post = 25;
$args_news = array(
'post_type' => 'post',
//'language' => 'khmer',
'tax_query' => array(
array(
'taxonomy' => 'language',
'field' => 'slug',
'terms' => 'khmer'
)
),
'paged' => $paged,
);
query_posts($args_news);
}else {
$number_latest_post = 25;
$args_news = array(
'posts_per_page' => $number_latest_post,
'post__not_in' => get_option('sticky_posts'),
'paged' => $paged,
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($args_news);
}
?>
<?php if(have_posts()) : ?>
<div class="section-title">
<div class="container">
<div class="eight columns">
<h1><?php the_title() ?></h1>
</div>
</div>
</div>
<?php get_template_part('loop'); ?>
<?php
endif;
wp_reset_query();
?>
<?php get_footer(); ?>