因此,我有single-portfolio.php,它提供了我的项目之一。链接到WordPress页面的“the_title()”中的其他网站
此功能为我的项目每次选择适当的标题。
<h1><?php the_title(); ?></h1>
现在什么项目,我选择它始终运输箱的安吉拉...
<h1><a href="https://twitter.com/angela_bradley"><?php the_title(); ?></a></h1>
我想要做的是有适当的链接标题中的适当项目。
我觉得这样,但它不起作用。
<?php
$f = "http://facebook.com/";
$t = "http://twitter.com/";
$l = "http://linkedin.com/";
if (the_title()=='Facebook') {
Echo "<a href=$f> Facebook</a>";
} elseif (the_title()=='Twitter') {
Echo "<a href=$t> Twitter</a>";
} else {
Echo "<a href=$l> Linkedin</a>";
}
?>
我得到的页面是什么,如果其Facebook页面或3倍的Twitter如书面Facebook的3倍:
FacebookFacebookFacebook(唯一的最后一个 “脸谱” 是一个链接)
非常感谢!这已经解决了我的问题:) – userlooser 2014-09-03 08:36:15