下面的简单函数似乎有点问题,但我不知道它是什么。它显示如下,我不明白为什么。我知道它与函数ID()、title()和permalink()有关,但我不知道它是什么。抱歉,如果这听起来像个愚蠢的问题。
1http://www.example.com/?p=1Hello world!<h1 class="title" id="post-"><a rel="bookmark" href=""></a></h1>
function basetheme_nodetitle($before_title="",$after_title="",$link = true) {
/*
* basetheme_nodetitle() can only be called inside the Loop
* $before_title is the initial tag in which to wrap your title, usually <h2> or similar.
* $after_title is the tag after the title, usually </h2> or similar. Only works if $before_title is NOT empty
* $link is whether or not the title should be linked. Default is true
*/
if(empty($before_title)){$before_title = \'<h1 class="title" id="post-\' . the_ID() . \'">\';$after_title = "</h1>";}
if($link == false){$beforelink = \'\';$afterlink = \'\';}else{$beforelink = \'<a rel="bookmark" href="\' . the_permalink() . \'">\';$afterlink = \'</a>\';}
echo $before_title . $beforelink . the_title() . $afterlink . $after_title;
}