• Resolved helms

    (@helms)


    I cannot register a sidebar widget using code snippets. It works in the funcitons.php file. I get a white screen when I activate it.

    Code:

    //* Register after post widget area
    genesis_register_sidebar( array(
    'id' => 'header_feature',
    'name' => __( 'Header Feature', 'GenStarter' ),
    'description' => __( 'This is a widget area that is placed after the Header', 'GenStarter' ),
    ) );

    Thanks for the help.

    https://www.ads-software.com/plugins/code-snippets/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Try running it on the after_setup_theme hook:

    add_action( 'after_setup_theme', function () {
    
    	addgenesis_register_sidebar( array(
    		'id' => 'header_feature',
    		'name' => __( 'Header Feature', 'GenStarter' ),
    		'description' => __( 'This is a widget area that is placed after the Header', 'GenStarter' ),
    	) );
    
    } );
    Thread Starter helms

    (@helms)

    Thanks for your response. It didn’t work. I copied your code into snippets.

    This is the error I get:
    Fatal error: Call to undefined function addgenesis_register_sidebar() in Z:\web\wp-content\plugins\code-snippets\php\snippet-ops.php(383) : eval()’d code on line 3

    Thread Starter helms

    (@helms)

    Never mind, your code worked, with the exception of

    addgenesis_register_sidebar( array(

    I removed the add if front of genesis_register_sidebar
    Didn’t notice that when I copied it.

    Thanks for your support, it’s a great plugin!

    Plugin Author Shea Bunge

    (@bungeshea)

    I’m glad that you could get it working!

    Fatal error: Call to undefined function genesis_register_sidebar() in /home/goadisa/public_html/wp-content/themes/estore/inc/widgets.php on line 1
    and my admin page is crash
    please reply

    Plugin Author Shea Bunge

    (@bungeshea)

    This has nothing to do with this plugin. Your theme is broken.

    can i deactivate theme but my dashboard is not working

    when I login to wp-admin then Fatal error: Call to undefined function genesis_register_sidebar() in /home/goadisa/public_html/wp-content/themes/estore/inc/widgets.php on line 12 error occured.how to resolved. I just tried to change widget.php.how to resolve this

    i adding code in widget.php
    that code is
    // Home page widgets
    genesis_register_sidebar( array(
    ‘id’ => ‘home-featured-full’,
    ‘name’ => __( ‘Home Featured Full’, ‘custom-genesis-sample’ ),
    ‘description’ => __( ‘This is the featured section if you want full width.’, ‘custom-genesis-sample’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-featured-left’,
    ‘name’ => __( ‘Home Featured Left’, ‘custom-genesis-sample’ ),
    ‘description’ => __( ‘This is the featured section left side.’, ‘custom-genesis-sample’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-featured-right’,
    ‘name’ => __( ‘Home Featured Right’, ‘custom-genesis-sample’ ),
    ‘description’ => __( ‘This is the featured section right side.’, ‘custom-genesis-sample’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-middle-1’,
    ‘name’ => __( ‘Home Middle 1’, ‘custom-genesis-sample’ ),
    ‘description’ => __( ‘This is the home middle left section.’, ‘custom-genesis-sample’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-middle-2’,
    ‘name’ => __( ‘Home Middle 2’, ‘custom-genesis-sample’ ),
    ‘description’ => __( ‘This is the home middle center section.’, ‘custom-genesis-sample’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-middle-3’,
    ‘name’ => __( ‘Home Middle 3’, ‘custom-genesis-sample’ ),
    ‘description’ => __( ‘This is the home middle right section.’, ‘custom-genesis-sample’ ),
    ) );

    and then iam getting fatal error
    and my admin is not working
    is there anything else i could try? please reply.

    Plugin Author Shea Bunge

    (@bungeshea)

    Like I said, this is an issue with your theme. Possibly, you are using a Genesis child theme without the parent theme installed. To resolve the issue, delete your theme folder using SFTP or similar.

    I can not access ftp server. is there is another way

    how to accsess ftp

    Plugin Author Shea Bunge

    (@bungeshea)

    This really isn’t the place to ask. Please check with your host or open a thread in the general forum.

    OK Thank you for reply

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Cannot register a sidebar widget’ is closed to new replies.