functions.php add widget explanation

This topic contains 3 replies, has 2 voices, and was last updated by  viguursthijs 9 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #39544

    viguursthijs
    Buyer
    Post count: 273

    Gentlemen,

    in your functions.php you give advice on how to add more widget-area’s, like this:
    ===

    /*
    to add more sidebars or widgetized areas, just copy
    and edit the above sidebar code. In order to call
    your new sidebar just use the following code:

    Just change the name to whatever your new
    sidebar’s id is, for example:

    register_sidebar(array(
    ‘id’ => ‘sidebar2’,
    ‘name’ => __( ‘Sidebar 2’, GEODIRECTORY_FRAMEWORK ),
    ‘description’ => __( ‘The second (secondary) sidebar.’, GEODIRECTORY_FRAMEWORK ),
    ‘before_widget’ => $before_widget,
    ‘after_widget’ => $after_widget,
    ‘before_title’ => $before_title ,
    ‘after_title’ => $after_title,
    ));

    To call the sidebar in your template, you can just copy
    the sidebar.php file and rename it to your sidebar’s name.
    So using the above example, it would be:
    sidebar-sidebar2.php
    ===

    I think I found a minor mistake in it, because if i follow this our whole site turns white.

    After adding this line everything worked fine again:
    if(!empty($gdf) && !$gdf[‘sidebar2’]){

    Does this make sense to you?

    #39547

    viguursthijs
    Buyer
    Post count: 273

    By the way, this is related to the wpgeotheme framework and it’s child modern something;-)

    #39611

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Above your code add this line:

    global $gdf;

    Let us know,

    Stiofan

    #39666

    viguursthijs
    Buyer
    Post count: 273

    I got it working, thanks!

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket