• Danstano

    (@danstano)


    Hi,

    I successfully created a new widget area in home but have a problem trying to get the widget to fit the width of content wrapper. I don’t want it stretching to the ends of the page. I don’t know whether this makes sense but please guide me on how I can span properly using class=”span12″. Note* I’m a newbie in this so I’ll need you to tell me what goes where :).
    Here’s screenshot to help you get the idea.

    https://www.mjomba.com/?p=5119&preview=true

    https://www.ads-software.com/themes/customizr/

    // 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="widget my-extra-widget">',
    	'after_widget' => '</div>',
    	'before_title' => '<h2>',
    	'after_title' => '</h2>'
    	));
    }
    
    // Place the widget area after main wrapper in home page only
    add_action ('__after_main_wrapper', 'add_my_widget_area', 10);
    function add_my_widget_area() {
      if ( tc__f('__is_home') && function_exists('dynamic_sidebar') ) {
        dynamic_sidebar('Extra Header Widget Area');
      }
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    I visited your URL, but it doesn’t exist now.

    Have your problem resolved already?

    Thread Starter Danstano

    (@danstano)

    Kharis I haven’t resolved it yet. The link I gave here is working. On the page, you’ll see an image with arrows. That’s where I want you to look. The arrows are an indication of how I want the widget to resize. Until I solve this, I don’t want it to show in homepage which is why I created a preview post that shows the widget in action and how it spans out of place.

    Denzel Chia

    (@denzel_chia)

    Hi,

    The following link that you have provided is a post preview.
    https://www.mjomba.com/?p=5119&preview=true

    In WordPress, only logged in author or administrator of the post can see it’s post preview. Nobody in this forum can see it.

    You should upload a screenshot with annotation to an image sharing site such as https://share.pho.to/ and post the link here.

    Thanks!

    Thread Starter Danstano

    (@danstano)

    Thank you for trying to help. Sorry about the last link. Here is what I want to achieve.
    My new widget in homepage spreads the entire width. I want it to fit the width of content wrapper just like the other posts as shown my the marks and arrows. Thanks and hopefully the image helps.
    https://pho.to/9tiPb

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘New widget in home stretches entire width’ is closed to new replies.