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] Making a new widget area


  #1  
Old Aug 1, 2009, 03:52 PM
xxxevilgrinxxx's Avatar
xxxevilgrinxxx
 
10 posts · Jan 2009
hello,

I'm running the latest Atahualpa version, 342, and was looking to play with adding some new widget areas.

I've got a test area set up to play with this:
http://foreverdyingbrightly.com/testblog/

added this to the content area of the 'footer' section in ATO:
Code:
<?php bfa_widget_area('name=footer widget&cells=2&align_1&align_2=2&width_1=150&width_2=300'); ?>
And I'm coming up with this in the footer area:
Code:
Fatal error: Call to undefined function: str_ireplace() in /home/forev26/public_html/testblog/wp-content/themes/atahualpa3/functions.php on line 321
what can I do to make this work?
*Once I know, I'll likely test it out in the header and content areas as well...I sense more questions just around the corner :D *

thx in advance,
Elaine
  #2  
Old Aug 2, 2009, 06:16 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
If you have any plugins, please disable them all and see if the problem still exists
How have you gone about shutting off the left sidebar?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Aug 2, 2009, 07:28 AM
xxxevilgrinxxx's Avatar
xxxevilgrinxxx
 
10 posts · Jan 2009
it's a bare bones test environment so I'm only running akismet, dolly, Page Navi and Series. Nope, no dice there, I'm still getting no widgety goodness.

Stranger still, str_ireplace() doesn't exist anywhere in the functions.php file I suppose that makes sense why it can't be found, but why is it looking? I even uploaded a clean copy of the functions.php file, to no avail. I'm stumped (I'm a somewhat regular-ish donator if that helps :D 'qwstnevrythg@gmail.com').

Maybe if someone's got a blog where there are extra widgets added so that I could have a look and maybe rummage through code to see what's gone wacky with mine? I'm not a genius but a fairly okay tinkerer.

As for the left sidebar, it technically still exists and shows up in my admin panel, I've just 'removed' it on the sidebar page in ATO.

thanks in advance for the help
Elaine

ps...just a weird random thought, is str_ireplace() a typo? I'm off to see if getting rid of that 'i' will blow anything up. Just have to find out where the 'i' is coming from. So far I've gone through most of the theme files and can't come across it, drat.

Last edited by xxxevilgrinxxx; Aug 2, 2009 at 08:56 AM.
  #4  
Old Aug 2, 2009, 09:07 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Did you add a widget to the footer? I put in your code and it runs fine. I'll try adding a 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 2, 2009, 09:21 AM
xxxevilgrinxxx's Avatar
xxxevilgrinxxx
 
10 posts · Jan 2009
thanks, Juggledad.
In theory, I'm thinking that this should create a new widget area in my admin panel.
http://i32.photobucket.com/albums/d2...f/73662a6f.jpg
I have one 'blank' space, so I dropped a calendar in there for the heck of it. Still no good. Can you drop me a link where the new widget works so that I can have a look?

btw, it's good to know that the line of code works, that's one less thing to worry about

ETA:
I think it may be a typo(?)
in functions.php , in the custom widgets area:
Code:
function bfa_widget_area($args = '') {
	$defaults = array(
		'cells' => 3,
		'align' => 2,
		'before_widget' => '<div id="%1$s" class="widget %2$s">',
		'after_widget' => '</div>',
		'before_title' => '<div class="widget-title"><h3>',
		'after_title' => '</h3></div>',
	);
	
	$r = wp_parse_args( $args, $defaults );
	extract( $r, EXTR_SKIP );

	$area_id = strtolower(str_ireplace(" ", "_", $r['name']));

I went in and took out that 'i' in str_ireplace and at least my error message went away. I'll investigate further (boy, being dyslexic and looking for errors is fun! *snorks*)

excellent, now my new widget areas show up in the admin area as well, yay!
http://i32.photobucket.com/albums/d2...f/077d9438.jpg


the result is ugly but it was more about getting the thing to show up:
http://i32.photobucket.com/albums/d2...f/9ac4fe06.jpg
thanks!
Elaine

Last edited by xxxevilgrinxxx; Aug 2, 2009 at 09:43 AM.
  #6  
Old Aug 2, 2009, 10:33 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
str_ireplace is a PHP function (see http://www.w3schools.com/php/func_st...r_ireplace.asp) and I think it was added in version 5. Do you know what version of PHP are you running? I'll bet it is 4.x

several host providers default to version 4, but there are ways to have them switch to version 5.

One quick way to find out is to install wp-security-scan (http://wordpress.org/extend/plugins/wp-security-scan/) which dumps some system info on it's main page which will tell you the PHP version
__________________
"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 2, 2009, 02:49 PM
xxxevilgrinxxx's Avatar
xxxevilgrinxxx
 
10 posts · Jan 2009
thanks, I'm running PHP4 right now. Maybe when I get home I'll have to switch it to 5 to see if it does anything new for me but for the moment, changing that one letter seems to make all the difference between the two versions. Now I'll be playing around seeing what the two different functions do For a tinkerer, this is a lot of fun :D
I'm sure if I've experienced this, other people will have as well, so thanks for all the help, Juggledad! I'd say this one is closed :D
Elaine
  #8  
Old Aug 2, 2009, 03:47 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
FYI - same problem, solution - PHP5 see http://forum.bytesforall.com/showthread.php?t=2747)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
WPMU - new widget area(S) ? teros Sidebars & Widgets 3 Sep 5, 2009 04:22 AM
Making the tagline logo area read page title maguai Header configuration & styling 4 Aug 18, 2009 10:53 AM
Improvements / suggestions for header widget area Joep Hein Header configuration & styling 1 Jul 22, 2009 12:18 PM
New widget area in header paulae Sidebars & Widgets 10 Jul 3, 2009 01:45 PM
Making one specific widget different than the others. Nourdmrolnmt1 Sidebars & Widgets 0 Mar 26, 2009 08:51 PM


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


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