2013-06-20 45 views
0

我的頁腳正在鏈接音樂頁面上的帖子,無法弄清楚爲什麼它會混淆。我想分開像其他網頁。僅供參考,我使用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

我假設它給你沒有錯誤開發人員工具或頁面源視圖? b.c通常這些東西只是一個缺少的div或關閉標籤或什麼不應該在源代碼中顯示爲鉻或火狐 – bob

+0

是的,我沒有得到任何錯誤。但是,我一定能夠發現這樣的錯誤,但這會帶來更多的經驗。很高興爲我這樣的初學者提供了Stackoverflow。感謝您的輸入。 – Waymond

回答

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>

+0

非常感謝。我仍然是一個noob和發展,所以我很感激。 – Waymond

+0

樂意幫忙!我們都從某個地方開始。你已經關閉了:} –

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(); ?>