Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » New Versions, & Updating »

[SOLVED] 3.6.7 PHP error when adding widget areas


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old May 14, 2011, 07:24 AM
jakobsmith
 
32 posts · Feb 2010
Copenhagen
I'm having this problem with ATA 3.6.7:

I want to have a frontpage on the site with 3 widget areas (columns) in the center column area. Due to the recent changes to the theme, I'm adding this widget area code in index.php:

PHP Code:
    if (is_front_page()) {
    
bfa_widget_area('name=ForsideWidgets&cells=3&before_widget=<div id="%1$s" class="header-widget %2$s">&after_widget=</div>');
    } else {
    echo 
"";
    } 
The 3 widget areas appears on the front page, but above them I also get these errors, one for each widget area:

Warning: array_key_exists() expects parameter 2 to be array, string given in /var/www/(domain removed)/public_html/wp-content/themes/atahualpa367/functions.php on line 404

Warning: array_key_exists() expects parameter 2 to be array, string given in /var/www/(domain removed)/public_html/wp-content/themes/atahualpa367/functions.php on line 404

Warning: array_key_exists() expects parameter 2 to be array, string given in /var/www/(domain removed)/public_html/wp-content/themes/atahualpa367/functions.php on line 404

On line 403-407 in functions.php, I have:

PHP Code:
        // Check if any of the cells have a set width
        
for ( $i 1$i <= $r['cells']; $i++ ) { 
            if ( 
array_key_exists('width_' $i$args) AND !empty($args['width_' $i]) ) {
                    
$colgroup 'yes';
            }
        } 
Anyone knows what the problem is?

Server: Apache/2.2.17 (Unix) PHP/5.3.5
  #2  
Old May 14, 2011, 07:48 AM
juggledad's Avatar
juggledad
 
22,381 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
where in index.php did you add the code?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old May 14, 2011, 07:58 AM
jakobsmith
 
32 posts · Feb 2010
Copenhagen
I put it on lines 40-44.

I've used the same code with the Shortcode Exec PHP-plugin and got the same errors.

Guess I could remove the errors by turning off PHP error reporting, but that doesn't seem like a good solution.
  #4  
Old May 14, 2011, 08:33 AM
juggledad's Avatar
juggledad
 
22,381 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
Try this, edit functions.php and change line 404 from
HTML Code:
			if ( array_key_exists('width_' . $i, $args) AND !empty($args['width_' . $i]) ) {
to
HTML Code:
			if ( array_key_exists('width_' . $i, $r) AND !empty($r['width_' . $i]) ) {
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old May 14, 2011, 09:18 AM
jakobsmith
 
32 posts · Feb 2010
Copenhagen
Quote:
Originally Posted by juggledad
Try this, edit functions.php and change line 404 from
HTML Code:
			if ( array_key_exists('width_' . $i, $args) AND !empty($args['width_' . $i]) ) {
to
HTML Code:
			if ( array_key_exists('width_' . $i, $r) AND !empty($r['width_' . $i]) ) {
It solved the problem. Thanks a lot

Bookmarks

Tags
3.6.7, functions.php, php errors, widget areas

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding multiple widget areas to header bodger Sidebars & Widgets 1 Feb 7, 2011 01:41 PM
Adding New Widget Areas & Position Widgets in Area Ogregeek Sidebars & Widgets 11 Jan 7, 2011 10:09 AM
[SOLVED] Adding Widget areas incorrectly? twomomsdesigns Sidebars & Widgets 3 Aug 20, 2010 09:30 AM
[SOLVED] Adding widget areas in the header joaodagraca Sidebars & Widgets 6 Aug 14, 2009 08:44 AM
adding new widget areas? dbweim Sidebars & Widgets 1 Aug 8, 2009 05:28 AM


All times are GMT -6. The time now is 05:13 PM.


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