2013-02-23 40 views
0

我想有这些社交图标浮动:权在我的页脚。但是,当我尝试关闭PHP标签之前>:我怎样才能使这个PHP片段浮动:在我的页脚,但仍然在页面的正文?

<span style="float:right;"><?php if (function_exists('cn_social_icon')) echo 
cn_social_icon(); ?></span> 

它给我:

Parse error: syntax error, unexpected '<' in /home/jpweber/public_html/footer.php 
on line 33 

如果我把它下面关闭PHP标签,>,它的工作原理,但出现外部页面的正文,方式在屏幕的右下角(在蓝色区域)。

我想它的页面的正文中,但我希望得到它漂浮到右边。我可以得到它的身体内出现的唯一方法就是用这种闭幕PHP标记上方:

if (function_exists('cn_social_icon')) echo cn_social_icon(); 

下面收盘>?。但它不会浮动:正确enter image description here

所以我必须从某个地方执行一些代码在页脚,这是目前这个,你在图片中看到,其中如果(function_exists(“cn_social_icon”))回声cn_social_icon();只是在那里混合:

<?php 
/** 
* Builds the footer structure. 
* 
* @package Catalyst 
*/ 

global $catalyst_layout_id; 
if (function_exists('cn_social_icon')) echo cn_social_icon(); 
if(!is_page_template('template-blank-body.php')) 
{ 
catalyst_hook_before_before_footer($catalyst_layout_id . '_catalyst_hook_before_before_footer'); 
catalyst_hook_before_footer($catalyst_layout_id . '_catalyst_hook_before_footer'); 
catalyst_hook_after_before_footer($catalyst_layout_id . '_catalyst_hook_after_before_footer'); 
catalyst_hook_footer($catalyst_layout_id . '_catalyst_hook_footer'); 

catalyst_hook_before_after_footer($catalyst_layout_id . '_catalyst_hook_before_after_footer'); 
catalyst_hook_after_footer($catalyst_layout_id . '_catalyst_hook_after_footer'); 
catalyst_hook_after_after_footer($catalyst_layout_id . '_catalyst_hook_after_after_footer'); 
} 
wp_footer(); 

catalyst_hook_after_html($catalyst_layout_id . '_catalyst_hook_after_html'); 

/** 
* Un-comment the below function to list all items currently hooked into a WordPress or Catalyst hook. 
*/ 
//catalyst_list_hooked(); 
/** 
* Un-comment the below function to display the number of database queries during the WordPress execution. 
*/ 
//echo get_num_queries(); 
?> 

</body> 

</html> 

任何帮助将不胜感激!

+0

发布整个footer.php的内容 – 2013-02-23 00:22:53

+0

谢谢尼古拉斯;我编辑了这个问题以包含整个页脚。感谢您花时间尝试帮助! – 2013-02-23 00:29:14

+0

使用这个footer.php,你仍然在第33行得到这个错误? – 2013-02-23 00:31:15

回答

1

不知道到底是哪钩你要找的,但尝试所有的人都使用以下格式:

替换:

if (function_exists('cn_social_icon')) echo cn_social_icon(); 

有了:

function add_social_icons() { 
    if (function_exists('cn_social_icon')) echo cn_social_icon(); 
} 
add_action($catalyst_id.'_catalyst_hook_before_before_footer', 'add_social_icons'); 
+0

尝试各种地方的各种钩子......没有出现错误,但没有任何显示......当我查看html输出时,没有任何内容表示任何社交媒体图标或链接。我会继续尝试!再次感谢尼古拉斯! – 2013-02-23 02:34:54

+1

您的主题文件夹中是否存在'template-blank-body.php'? – 2013-02-23 02:37:56

+0

是的......所有这是...是这样的: 2013-02-23 02:44:31

相关问题