我相信你不應該添加代碼到與您的wordpress配置沒有直接關係的functions.php文件(比如php的自定義文章類型和函數)。
恢復您的functions.php文件和任何額外的代碼,你已經添加到您的文件;然後嘗試:
查找的header.php之間的<head> </head>
標籤包含以下代碼:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<?php if (is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); wp_head(); ?>
一個簡單的測試,看看jQuery是在頭工作;
<script type="text/javascript">
$(function(){
$(".scrollable").scrollable();
});
</script>
在標題中添加以下內容:
<style type="text/css">
/*
root element for the scrollable.
when scrolling occurs this element stays still.
*/
.scrollable {
/* required settings */
position:relative;
overflow:hidden;
width: 660px;
height:90px;
}
/*
root element for scrollable items. Must be absolutely positioned
and it should have a extremely large width to accommodate scrollable items.
it's enough that you set width and height for the root element and
not for this element.
*/
.scrollable .items {
/* this cannot be too large */
width:20000em;
position:absolute;
}
/*
a single item. must be floated in horizontal scrolling.
typically, this element is the one that *you* will style
the most.
*/
.items div {
float:left;
}
</style>
你爲什麼不加入CSS和JQuery包括反對功能文件中的標題? – Xavier
我讀過的功能是所有包含應該在哪裏。我實際上已經嘗試了很多東西,這是最實用的版本。當我能做到這一點時,我會(慢慢地)把它放在應該去的地方。 – Steve