Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

[SOLVED] Adding widget areas in the header


  #1  
Old Aug 13, 2009, 01:52 PM
joaodagraca's Avatar
joaodagraca
 
20 posts · Jul 2009
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
  #2  
Old Aug 14, 2009, 04:04 AM
joaodagraca's Avatar
joaodagraca
 
20 posts · Jul 2009
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
  #3  
Old Aug 14, 2009, 04:30 AM
joaodagraca's Avatar
joaodagraca
 
20 posts · Jul 2009
I will gladly make another donation if you can solve this easily.

Thanks
  #4  
Old Aug 14, 2009, 04:53 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
What would you do with a 2px widget?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Aug 14, 2009, 05:35 AM
joaodagraca's Avatar
joaodagraca
 
20 posts · Jul 2009
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?
  #6  
Old Aug 14, 2009, 06:23 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Aug 14, 2009, 07:44 AM
joaodagraca's Avatar
joaodagraca
 
20 posts · Jul 2009
WOW! This incredible. The code you gave me produces exactly what I wanted.
Many thanks.
I have made a donation!
Have a great weekend

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding new widget areas? dbweim Sidebars & Widgets 1 Aug 8, 2009 04:28 AM
[SOLVED] Theme is adding a border around my AddThis widget at bottom of posts daneo Post-Kicker, -Byline & -Footer 7 Jul 15, 2009 05:42 PM
Adding php in a text widget? trinity Sidebars & Widgets 2 Jun 15, 2009 08:44 AM
adding text in search widget ppat2 Sidebars & Widgets 1 Apr 28, 2009 12:09 AM
Moved side bars to right side, now have dotted lines around areas tomlucas Sidebars & Widgets 1 Apr 16, 2009 05:24 PM


All times are GMT -6. The time now is 09:09 AM.


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