2011-12-16 41 views
0

我使用的导航这个代码在我的头版:文章导航代码

<h13><div class="navigation"> 

<div class="next-posts"> 
    <div id="image_left"><?php next_posts_link('<img src="IMG URL"/>') ?></div> 

    <div id="posts_left"><h12><?php next_posts_link('Older Stuff') ?></h12></div> 
</div> 

<div class="prev-posts"> 
    <div id="posts_right"><h12><?php previous_posts_link('Newer Stuff') ?></h12></div> 

    <div id="image_right"><?php previous_posts_link('<img src="IMG URL"/>') ?></div> 
</div> 

我想为我的单篇文章观点相同的导航,但我不能得到它的工作,我做了PHP函数的变化,但在Codex中,我只发现了一个显示来自同一类别的帖子的可能性。 此外,我不希望链接显示前一个/下一个帖子的标题,只有我定义的文本。最后还有一件事,我无法在单一视图中使图像导航工作,但它在我的主页中完美无瑕。

这是我的代码的时刻:

<h13><div class="navigation"> 

<div class="next-post"> 
    <div id="img_left"><?php next_post_link('<img src="IMG URL"/>') ?></div> 

    <div id="post_left"><h12><?php next_post_link('%link', 'Next post', TRUE); ?></h12></div> 
</div> 

<div class="prev-post"> 
    <div id="post_right"><h12><?php previous_post_link('%link', 'Previous post', TRUE); ?></h12></div> 

    <div id="img_right"><?php previous_post_link('<img src="IMG URL"/>') ?></div> 
</div> 

回答

1

H13和H12?我不知道标题涨得这么高!

我猜你已经看过Codex Page for the next_post_link() function.但是你确定在回路中包含呼叫吗?另外,尝试在功能中添加额外的参数。有时他们会感到困惑。

+0

我使用了`h12/h13`,这样我就可以更容易地控制它们。我阅读了关于该主题的食典,但是如果不显示帖子标题,我无法使其工作。它不会仅用上面的代码显示标题。 – rlesko 2011-12-17 11:41:29