Менюто с джаджи не се показва на таблото за управление на wordpress

Разработвам тема за wordpress, но останах в уиджетизирането на моята wp тема, последвах няколко урока, но все още не работи. Менюто ми с джаджи не се показва на таблото ми за управление. Това е моята функция и странична лента, която имам: function.php: http://pastebin.com/X679LmVM

<?php

function custom_enqueue_scripts() {

        wp_deregister_script( 'jquery' );

        wp_register_script( 'jquery', get_template_directory_uri() . '/bin/js/jquery-1.10.1.min.js', 'jquery', '1.10.1',TRUE);
        wp_register_script( 'fittext', get_template_directory_uri() . '/bin/js/jquery.fittext.js', 'jquery', '1.0',TRUE );

        wp_enqueue_script( 'jquery' );
        wp_enqueue_script( 'fittext' );

}
add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts' );

if (function_exists('register_sidebar')) {

        register_sidebar(array(
                'name' => 'Widgetized Area',
                'id'   => 'katuhu',
                'description'   => 'This is a widgetized area.',
                'before_widget' => '<div id="%1$s" class="widget %2$s">',
                'after_widget'  => '</div>',
                'before_title'  => '<h4>',
                'after_title'   => '</h4>'
        ));

}

?>

sidebar.php: http://pastebin.com/0TvAKBZy

<div id="katuhu">

        <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Widgetized Area')) : else : ?>

        <div class="pre-widget">
                <p><strong>Widgetized Area</strong></p>
                <p>This panel is active and ready for you to add some widgets via the WP Admin</p>
        </div>

        <?php endif; ?>

</div>

Бихте ли ми помогнали, бях разочароващ няколко дни :(. Благодаря ви за помощта предварително.


person Mulyawan Sentosa    schedule 16.07.2013    source източник


Отговори (2)


Поставете тези редове код във function.php

if (function_exists("register_sidebar")) {
register_sidebar();
}

Поставете това в sidebar.php

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<?php $image = new WP_query ('showposts=1');
if(have_posts()) : while($image->have_posts()) : $image->the_post; ?>

  <a href="/bg<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to 
 <?php  the_title_attribute(); ?>"><?php postimage(); ?></a>

 <?php endwhile; endif; rewind_posts; ?>
person Saranya Arun    schedule 10.02.2014

Използвах този страхотен урок само онзи ден за създаване на джаджа, работи добре и ако следвате всички стъпки, ще видите опцията за джаджа, която се появява в администраторската ви страна: http://wp.tutsplus.com/tutorials/creative-coding/building-custom-wordpress-widgets/

person phil    schedule 17.07.2013