我的页脚正在链接音乐页面上的帖子,无法弄清楚它为什么会混淆。我想像其他页面一样分开。仅供参考,我使用wordpress插件自定义字段在音乐页面上创建帖子。 http://listentotheway.com/music/
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(); ?>
style.css:
/* music page */
#music-content {
display: block;
float: left;
}
/* Footer */
footer {
background-color: #eaeaea;
display: block;
clear: both;
border-top: 1px black solid;
}
答案 0 :(得分:2)
您尚未关闭内容中的<a>
链接标记,并且您的链接格式不正确。
>
之后没有大于<a href=".."
的结束,并且锚文本后面没有标记关闭</a>
。
<h3><a href="http://listentotheway.com/music/here-is-another-one/"Here is another one</h3>
YAY
<h3><a href="http://listentotheway.com/music/this-is-a-music-project/"This is a music project</h3>
This is where you find music
看起来应该更像:
<h3><a href="http://listentotheway.com/music/here-is-another-one/">Here is another one</a></h3>
YAY
<h3><a href="http://listentotheway.com/music/this-is-a-music-project/">This is a music project</a></h3>
This is where you find music
在你的PHP中:
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
答案 1 :(得分:0)
请使用此功能再试一次
<?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(); ?> </a></h3>
<?php the_field('description'); ?> <-----This has to do with the plugin.
<?php endwhile;?>
<?php endif; ?>
</div>
</div>
<?php get_footer(); ?>