I tried to customize my WordPress theme but it shows this error.
Your theme has 2 widget areas, but this particular page doesn’t display them. You can navigate to other pages on your site while using the Customizer to view > and edit the widgets displayed on those pages.
First, there didn't show widget area so I Add this code for that then it shows widget and but now show the above error.
if (function_exists("register_sidebar")) {
register_sidebar();
}
This is my function.php file how can I solve this issue. Do I want to change any other page?
<?php
/**
* Enqueues scripts and styles.
*
*/
if (function_exists("register_sidebar")) {
register_sidebar();
}
function umk_enque_scripts() {
wp_enqueue_style( 'normalize-style', get_template_directory_uri() . '/css/normal.css' );
wp_enqueue_style( 'umkthemes-style', get_stylesheet_uri() );
wp_enqueue_style( 'custom-css', get_template_directory_uri() . '/css/custom.css' );
wp_enqueue_style( 'landmark', get_template_directory_uri() . '/css/landmark-map.css' );
// wp_enqueue_script( 'umkthemes-script', get_template_directory_uri(). '/js/responsiveslides.min.js', array( 'jquery' ), '1.0' );
}
add_action( 'wp_enqueue_scripts', 'umk_enque_scripts' );
function umkthemes_setup() {
add_theme_support ('menus');
add_theme_support( 'post-thumbnails' );
// set_post_thumbnail_size( 273 , 146 );
register_nav_menus( array(
'primary_menu' => 'Main navigation',
) );
}
add_action( 'after_setup_theme', 'umkthemes_setup' );
// Our custom post type function
function create_posttype() {
register_post_type( 'sale',
// CPT Options
array(
'labels' => array(
'name' => __( 'Sale' ),
'singular_name' => __( 'Sale' ),
'all_items' => __('All Sales', 'umkthemes'), /* the all items menu item */
'add_new' => __('Add New Sale', 'umkthemes'), /* The add new menu item */
'add_new_item' => __('Add New Sale', 'umkthemes'), /* Add New Display Title */
'edit' => __( 'Edit', 'jointstheme' ), /* Edit Dialog */
'edit_item' => __('Edit Sale', 'umkthemes'), /* Edit Display Title */
'new_item' => __('New Sale', 'umkthemes'), /* New Display Title */
'view_item' => __('View Sale', 'umkthemes'), /* View Display Title */
'search_items' => __('Search Sale', 'umkthemes'), /* Search Custom Type Title */
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'sale'),
'supports' => array( 'title', 'editor', 'thumbnail', )
)
);
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );
if(!function_exists("register_sidebar")) { /* Your Code */ }
register_sidebar()
has been a part of core since 2.2.0, really it's rather strange change to check for it's existence at all... @RUC...register_sidebar()
creates a new area for widgets, but it does not display it. You'll need a call todynamic_sidebar()
for that.