• Resolved oltrecomics

    (@oltrecomics)


    Is it possible to add 2 or 3 widget area?

    I tried this tutorial:
    http://presscustomizr.com/snippet/add-widget-area-header/
    and I added some lines of code:

    // Adds a widget area.
    if (function_exists('register_sidebar')) {
    	register_sidebar(array(
    	'name' => 'Extra Header Widget Area',
    	'id' => 'extra-widget-area',
    	'description' => 'Extra widget area after the header',
    	'before_widget' => '<div class="row-fluid">
    <div class="span8">',
    	'after_widget' => '</div>',
    	'before_title' => '<h2>',
    	'after_title' => '</h2>'
    	));
    }
    
    // Adds a widget area2.
    if (function_exists('register_sidebar')) {
    	register_sidebar(array(
    	'name' => 'Extra Header Widget Area 2',
    	'id' => 'extra-widget-area-2',
    	'description' => 'Extra widget area after the header',
    	'before_widget' => '<div class="span4">',
    	'after_widget' => '</div></div>',
    	'before_title' => '<h2>',
    	'after_title' => '</h2>'
    	));
    }
    
    // Place the widget area after the header
    add_action ('__before_fp', 'add_my_widget_area', 10);
    function add_my_widget_area() {
    if (function_exists('dynamic_sidebar')) {
    dynamic_sidebar('Extra Header Widget Area');
    dynamic_sidebar('Extra Header Widget Area 2');
    }
    }

    Unfortunately does not work well.
    Whenever I add a widget, it adds a new widget area

    PS: sorry for my bad English

Viewing 10 replies - 1 through 10 (of 10 total)
  • with that code you’re adding two widget areas one above the other and bot before the featured pages.
    Don’t understand what you mean with “Whenever I add a widget, it adds a new widget area” πŸ˜€

    Thread Starter oltrecomics

    (@oltrecomics)

    Sorry πŸ™
    my English is very very bad (I’m Italian).
    I would like to put 2 or 3 widget area (two or three columns), how should I do?

    Thread Starter oltrecomics

    (@oltrecomics)

    I try to make myself understood through the following image:

    Thread Starter oltrecomics

    (@oltrecomics)

    I try to make myself understood through the following image:
    http://i60.tinypic.com/sfv3mc.jpg

    Ah, so something like, instead of this:

    // Place the widget area after the header
    add_action ('__before_fp', 'add_my_widget_area', 10);
    function add_my_widget_area() {
    if (function_exists('dynamic_sidebar')) {
    dynamic_sidebar('Extra Header Widget Area');
    dynamic_sidebar('Extra Header Widget Area 2');
    }
    }

    this:

    // Place the widget area after the header
    add_action ('__before_fp', 'add_my_widget_area', 10);
    function add_my_widget_area() {
      if (function_exists('dynamic_sidebar')) {
    ?>
        <div class="my-extra-widget-area row-fluid">
          <div class="first-column span8">
            <?php dynamic_sidebar('Extra Header Widget Area'); ?>
          </div>
          <div class="second-column span4">
            <?php dynamic_sidebar('Extra Header Widget Area 2'); ?>
          </div>
        </div>
    <?php
      }
    }

    Thread Starter oltrecomics

    (@oltrecomics)

    Thank You very much πŸ™‚

    Hi oltrecomics,
    you’re welcome.
    If you think you solved, would you mind marking this topic as resolved?

    Thank you πŸ˜‰

    Thread Starter oltrecomics

    (@oltrecomics)

    Hi d4z_c0nf,
    sorry to bother you again, but I have another problem.
    Although there are not active widgets, there is a blank space (widget area).
    Take a look at the following image:
    http://i61.tinypic.com/4khgqq.jpg

    How can I to hide that blank space?

    Thanks in advance

    The blank space is there ’cause spanN have a min-height whether they are empty or not, you can try this, hoping it will not have any side effect:

    .my-extra-widget-area [class*=span] {
        min-height: 0;
    }

    Cheers

    Thread Starter oltrecomics

    (@oltrecomics)

    What a fool I am πŸ™
    I thought of having to use php code, instead it was enough to use css.
    As always you are of great help.
    Thanks for all πŸ™‚

    PS: Congratulations for Customizr, it is really customizable … It is the best theme I have ever used

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

The topic ‘Adding 2 or 3 widget area’ is closed to new replies.