嗨,我正在尝试更改主页,因为我想有一个滑块,只向下移动一个类别的文章。
您可以在线查看页面:http://goaboa.it/home-2014/
我在主页上看不到任何文章。。。
您能帮我正确更改代码,只显示ID为17的类别,名为“home2014”。
您可以在此处查看有关我的新模板的代码:
<?php
/*
Template Name: HOME 2014 BIS
*/
?>
<?php get_header(); ?>
<section id="omc-main">
<?php
$displayed = false;
if (function_exists(\'shareit_output\')) {
$h_sticky = shareit_output();
$home_page = get_option (\'shareit_home\', 0);
if (!$displayed and $h_sticky && $home_page == 1) {
echo $h_sticky;
$displayed = true;
}
}
?>
<?php get_template_part( \'loop\', \'flexslider-homepage\' ); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
<br class="clear" />
<?php
foreach((get_the_category()) as $category) {
echo $category->cat_ID . \'17\';
} ?>
<?php // Category - Featured Slider
$category_id = get_cat_ID( \'17\');
$category_featured_enabled = get_tax_meta($category_ID,\'omc_featured_slider\');
if ($category_featured_enabled == \'on\') { get_template_part(\'loop\', \'module-flex\'); } else { ?>
<?php } ?>
<?php // Determine whether to use a preset blog style or echo content (with shortcodes)
$category_blog_style = get_tax_meta($category_ID,\'omc_blog_style\');
$category_content = get_tax_meta($category_ID,\'omc_content_field_id\');
if ($category_blog_style == \'\') {
get_template_part(\'loop\', \'blog-style-2\');
} else if ($category_blog_style == \'shortcodes\') {
echo do_shortcode($category_content);
} else {
get_template_part(\'loop\', $category_blog_style);
}
?>
</section><!-- /omc-main -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>