通过函数调用链接的简单php + css ..帮助 [英] Help with simple php + css.. calling in a link through a function
本文介绍了通过函数调用链接的简单php + css ..帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的项目中有代码,将导航中的按钮链接到Twitter帐户.我正在尝试将其复制到Facebook.我已经在CSS中制作了Facebook .li样式.新的FB按钮出现在Twitter btn的旁边,但我无法将其链接.我还创建了一个为Facebook输入字段的功能.
There''s code in my project that links a button in the navigation to a Twitter account. I''m trying to duplicate this for Facebook. I already made a Facebook .li style in the CSS. The new FB button appears next to the Twitter btn, but I can''t get it to link. I also created a function to make an input field for Facebook.
<?php if (get_option(THEME_PREFIX . "twitter_link")) { ?>
<li class="twitter"><a href="http://twitter.com/<?pho echo get_option(THEME_PREFIX . "twitter_link"); ?>"title"Twitter"></a></li>
<?php if (get_option(THEME_PREFIX . "facebook_link")) { ?>
<li class="facebook"><a href="http://facebook.com/<?pho echo get_option(THEME_PREFIX . "facebook_link"); ?>"title"Facebook"></a></li>
我很欣赏提供任何帮助!
I''d appreciate any help!
推荐答案
您的代码中显然有一些语法错误,但我认为它们只是错误.您确定正在生成有效的URL吗?
There are quite obviously some syntax errors in your code, but I assume they are just mistakes. Are you sure a valid URL is being produced?
您好,
我没有看到您在哪里关闭第一个if语句.好像您有一个嵌套的if语句.
if(get_option(THEME_PREFIX."twitter_link")){
//twitter链接
} ->尝试找到第一个if语句的右括号,并在其下面附加新的if语句.
如果(get_option(THEME_PREFIX."facebook_link")){
//Facebook链接
hello,
I didn''t see where you close the first if statement. Seem like you have a nested if statement.
if (get_option(THEME_PREFIX . "twitter_link")) {
//twitter link
} --> try locate the closing bracket for the first if statement and append the new if statement below it.
if (get_option(THEME_PREFIX . "facebook_link")) {
//Facebook link
<?php if (get_option(THEME_PREFIX . "twitter_link")) { ?>
<li class="twitter"><a href="http://twitter.com/<?pho echo get_option(THEME_PREFIX . "twitter_link"); ?>"title"Twitter"></a></li>
<?php } ?> //locate this
<?php if (get_option(THEME_PREFIX . "facebook_link")) { ?>
<li class="facebook"><a href="http://facebook.com/<?pho echo get_option(THEME_PREFIX . "facebook_link"); ?>"title"Facebook"></a></li>
<?php } ?
>
>
这篇关于通过函数调用链接的简单php + css ..帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文