wordpress-theme-cbsonline/module_top_list_post.php

61 lines
2.0 KiB
PHP
Raw Normal View History

2020-10-29 23:50:19 +09:00
<?php
/*-------------------------------------------*/
/* Post
/*-------------------------------------------*/
global $biz_vektor_options;
$postTopCount = $biz_vektor_options['postTopCount'];
if ($postTopCount != '0' ) :
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$post_loop = new WP_Query( array(
'post_type' => 'post',
'cat' => '-26',
'posts_per_page' => $postTopCount,
'paged' => $paged
) ); ?>
<?php if ($post_loop->have_posts()): ?>
<div id="topBlog" class="infoList">
<h2 class="entry-title">
<?php $locale = get_locale();
if ('en_US' == $locale ) { ?>
<!--英語表示の時-->
Announcements
<?php } else { ?>
<!--日本語表示の時 -->
お知らせ
<?php } ?>
</h2>
<ul class="entryListTop">
<?php $options = biz_vektor_get_theme_options();
if ( $options['listBlogTop'] == 'listType_set' ) { ?>
<?php while ( $post_loop->have_posts() ) : $post_loop->the_post();?>
<?php get_template_part('module_loop_post_news'); ?>
<?php endwhile ?>
<?php } else { ?>
<?php while ( $post_loop->have_posts() ) : $post_loop->the_post();?>
<?php get_template_part('module_loop_post'); ?>
<?php endwhile; ?>
<?php } ?>
</ul>
<?php // biz_vektor_pagination($post_loop->max_num_pages);
$postTopUrl = (isset($biz_vektor_options['postTopUrl']))? $biz_vektor_options['postTopUrl'] : '';
if ($postTopUrl) {
echo '<div class="moreLink right"><a href="'.esc_url($postTopUrl).'">';
printf( __( '%s List page', 'bizvektor-global-edition' ), esc_html($biz_vektor_options['postLabelName']) );
echo '</a></div>';
} ?>
<?php $locale = get_locale();
if ('en_US' == $locale ) { ?>
<!--英語表示の時-->
<p class="entryListTopList"><a href="<?php echo esc_url(home_url('/')); ?>announcements/">→View ALL</a></p>
2020-10-29 23:50:19 +09:00
<?php } else { ?>
<!--日本語表示の時 -->
<p class="entryListTopList"><a href="<?php echo esc_url(home_url('/')); ?>announcements/">→お知らせ一覧</a></p>
2020-10-29 23:50:19 +09:00
<?php } ?>
</div><!-- [ /#topBlog ] -->
<?php
endif; // $post_loop have_posts()
endif; // $postTopCpunt= 0
wp_reset_query();?>