I am developing a WordPress theme, but am stuck on widgetizing my theme.
I have followed several tutorials but still cannot get it to work.
My widgets menu does not appear under Appearance in my dashboard.
This is my function file and sidebar.
From function.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>'
));
}
From sidebar.php:
<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; ?>
`
The file name is
functions.php
, notfunction.php
. Note the “s”. Otherwise, the code should work, and does work when I try it.