2013-02-23 18 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

相關問題