0

私はこれを機能させるのに本当に苦労しています。どんな助けも宝くじのカルマで報われます :-)

バニラ WP サイトをインストールし、1 つの投稿と functions.php のみを編集して CSS を追加しました。これは問題を示しています。

functions.php にすべての jquery/tools wp_register_script/wp_enqueue_script 宣言を追加しても何も機能していなかったので、正気を保つために一時的に投稿します (これが正しい場所ではないことはわかっています)。

したがって、これはほぼ機能します。エラーは発生しませんが、ページ (WP なしで正常に動作します) はパネルのコンテンツをレンダリングしません。何か案は?Chrome コンソールを見ると、すべてのリソースが読み込まれ、すべてのスクリプトがそこにあります。

http://crystal-globe.com/jqt/

助けてくれてありがとう。毛が抜ける…

4

1 に答える 1

0

I believe you shouldn't be adding code to the functions.php file that are not directly related to your wordpress configuration (like custom post types and functions for php).

Revert your functions.php file and any extra code you've added to your files; then try:

Find header.php and between the <head> </head> tags include the following code:

<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(); ?>

as a simple test to see if jQuery is working in the header;

<script type="text/javascript">
$(function(){
$(".scrollable").scrollable();
});
</script>

In the header add the following:

<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>
于 2011-10-18T14:18:48.610 に答える