我的页脚链接了音乐页面上的帖子,无法弄清楚为什么它会混淆。我想像其他页面一样分开。仅供参考,我正在使用 wordpress 插件自定义字段在音乐页面上创建帖子。http://listentotheway.com/music/
音乐.php:
<?php
/*
Template Name: Music Page
*/
get_header(); ?>
<div class="wrapper">
<div id="music-content">
<p> This is music.php </p>
<?php
$args = array(
'post_type' => 'music'
);
$the_query = new WP_Query( $args );
?>
<?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<h3><a href="<?php the_permalink(); ?>"<?php the_title(); ?></h3>
<?php the_field('description'); ?> <-----This has to do with the plugin.
<?php endwhile; else: ?>
<?php endif; ?>
</div>
</div>
<?php get_footer(); ?>
样式.css:
/* music page */
#music-content {
display: block;
float: left;
}
/* Footer */
footer {
background-color: #eaeaea;
display: block;
clear: both;
border-top: 1px black solid;
}