Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter helpmepleasesos

    (@helpmepleasesos)

    thank you very much

    Thread Starter helpmepleasesos

    (@helpmepleasesos)

    function.php

    function my_sidebar()
    {
        register_sidebar( array(
            'name'          => __('Sidebar','sidebar'),
            'id'            => 'sidebar',
            'before_widget' => '<div>',
            'after_widget'  => '</div>',
            'before_title'  => '<h2>',
            'after_title'   => '</h2>',
        ) );
    }
    add_action('widgets_init','my_sidebar');

    sidebar.php
    <?php my_sidebar(); ?>

    Thread Starter helpmepleasesos

    (@helpmepleasesos)

    I rename my function in function.php

    Thread Starter helpmepleasesos

    (@helpmepleasesos)

    Now show this in the sidebar:
    Fatal error: Uncaught Error: Call to undefined function my_sidebars() in C:\xampp\htdocs\wordpress\wp-content\themes\tema\sidebar.php:27 Stack trace: #0 C:\xampp\htdocs\wordpress\wp-includes\template.php(722): require_once() #1 C:\xampp\htdocs\wordpress\wp-includes\template.php(671): load_template(‘C:\\xampp\\htdocs…’, true) #2 C:\xampp\htdocs\wordpress\wp-includes\general-template.php(111): locate_template(Array, true) #3 C:\xampp\htdocs\wordpress\wp-content\themes\tema\front-page.php(34): get_sidebar() #4 C:\xampp\htdocs\wordpress\wp-includes\template-loader.php(78): include(‘C:\\xampp\\htdocs…’) #5 C:\xampp\htdocs\wordpress\wp-blog-header.php(19): require_once(‘C:\\xampp\\htdocs…’) #6 C:\xampp\htdocs\wordpress\index.php(17): require(‘C:\\xampp\\htdocs…’) #7 {main} thrown in C:\xampp\htdocs\wordpress\wp-content\themes\tema\sidebar.php on line 27

Viewing 4 replies - 1 through 4 (of 4 total)