Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   [SOLVED] Adding widget areas in the header (http://forum.bytesforall.com/showthread.php?t=2952)

joaodagraca Aug 13, 2009 01:52 PM

[SOLVED] Adding widget areas in the header
 
Hi,

I would like to add a 2 X 800px cell widget area to the header but I would like them to be on top of each other as oposed to side by side. How would I do this?

Thanks

joaodagraca Aug 14, 2009 04:04 AM

I am using this code in the header config :

<?php bfa_widget_area('name=Banner&cells=2&align=1&width =800&before_widget=&after_widget='); ?>

The problem here is that the cells are split vertically and I need them to slipt horizontaly.
Is there a way of doing this?

Joao

joaodagraca Aug 14, 2009 04:30 AM

I will gladly make another donation if you can solve this easily.

Thanks

juggledad Aug 14, 2009 04:53 AM

What would you do with a 2px widget?

joaodagraca Aug 14, 2009 05:35 AM

Hi,

It's not a 2 px widget, it's two x 800 px wide widngets, horizontally placed on top of each other.

We are building a site which requires the same header image throughout all the pages, but we have product pages in which we dont want to use the header image, but rather want to insert some other code for a different fucntion.
So what I am want to do is place the 2 header widgets horizontally, the top one with the header image and the bottom one with the other html code, then hide them depending on the page i want to show.
Makes sense?

juggledad Aug 14, 2009 06:23 AM

NOTE: This will effect ALL extra widget areas!

You can try this. Edit functions.php and locate lines 323-358 which should be
HTML Code:

        echo '<table id="' . $area_id . '" class="bfa_widget_area" style="table-layout:fixed; width: 100%" cellpadding="0" cellspacing="0" border="0">';
       
        for ( $i = 1; $i <= $r['cells']; $i++ ) {
               
                        $current_name = $r['name'] . ' ' . $i;
                        $current_id = $area_id . '_' . $i;
                        $current_align = "align_" . $i;
                       
                        echo "\n" . '<td id="' . $current_id .'" ';
                       
                        if ( $r[$current_align] ) {
                                $align_type = $r["$current_align"];
                        } else {
                                $align_type = $r['align'];
                        }
                       
                        echo bfa_table_cell_align($align_type) . ">";
                       
                        // Register widget area
                        #$bfa_ata_widget_areas[] = $current_name;
                          $bfa_ata_widget_areas[] = array(
                                  "name" =>
$current_name,
                                  "before_widget" => $r['before_widget'],
                                  "after_widget" => $r['after_widget'],
                                  "before_title" => $r['before_title'],
                                  "after_title" => $r['after_title']
                                  );
         
                          // Display widget area
                        dynamic_sidebar("$current_name");
                       
                        echo "\n</td>";
           
        }
       
        echo '</table>';

and change them to this
HTML Code:

        echo '<table id="' . $area_id . '" class="bfa_widget_area" style="table-layout:fixed; width: 100%" cellpadding="0" cellspacing="0" border="0">';
        echo "\n<tr>";
        for ( $i = 1; $i <= $r['cells']; $i++ ) {
               
                        $current_name = $r['name'] . ' ' . $i;
                        $current_id = $area_id . '_' . $i;
                        $current_align = "align_" . $i;
                       
                        echo "\n" . '<tr id="' . $current_id .'" ';
                       
                        if ( $r[$current_align] ) {
                                $align_type = $r["$current_align"];
                        } else {
                                $align_type = $r['align'];
                        }
                       
                        echo bfa_table_cell_align($align_type) . ">";
                       
                        // Register widget area
                        #$bfa_ata_widget_areas[] = $current_name;
                          $bfa_ata_widget_areas[] = array(
                                  "name" =>
$current_name,
                                  "before_widget" => $r['before_widget'],
                                  "after_widget" => $r['after_widget'],
                                  "before_title" => $r['before_title'],
                                  "after_title" => $r['after_title']
                                  );
         
                          // Display widget area
                        dynamic_sidebar("$current_name");
                       
                        echo "\n</tr>";
           
        }
                                echo "\n</td>";

        echo '</table>';

This will make the widget area vertical instead of horizontal

joaodagraca Aug 14, 2009 07:44 AM

WOW! This incredible. The code you gave me produces exactly what I wanted.
Many thanks.
I have made a donation!
Have a great weekend


All times are GMT -6. The time now is 07:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.