Current location: Hot Scripts Forums » Programming Languages » PHP » Extra Wordpress Sidebars


Extra Wordpress Sidebars

Reply
  #1 (permalink)  
Old 10-19-07, 04:36 PM
xavier039 xavier039 is offline
Newbie Coder
 
Join Date: Aug 2006
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Extra Wordpress Sidebars

I have a wordpress blog and I would like to add more than one sidebar. I have my functions.php script to register 4 sidebars:
PHP Code:

<?php

if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'sidebar1',
'before_widget' => '<div id="%1$s" class="side-c %2$s">'// Removes <li>
'after_widget' => '</div>'// Removes </li>
'before_title' => '<h3>'// Replaces <h2>
'after_title' => '</h3>'// Replaces </h2>
));
register_sidebar(array('name'=>'sidebar2',
'before_widget' => '<div id="%1$s" class="side-c %2$s">'// Removes <li>
'after_widget' => '</div>'// Removes </li>
'before_title' => '<h3>'// Replaces <h2>
'after_title' => '</h3>'// Replaces </h2>
));
register_sidebar(array('name'=>'sidebar3',
'before_widget' => '<div id="%1$s" class="side-c %2$s">'// Removes <li>
'after_widget' => '</div>'// Removes </li>
'before_title' => '<h3>'// Replaces <h2>
'after_title' => '</h3>'// Replaces </h2>
));
register_sidebar(array('name'=>'sidebar4',
'before_widget' => '<div id="%1$s" class="side-c %2$s">'// Removes <li>
'after_widget' => '</div>'// Removes </li>
'before_title' => '<h3>'// Replaces <h2>
'after_title' => '</h3>'// Replaces </h2>
));
?>
My sidebar.php script is set for 4 sidebars as well:
PHP Code:

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar1') ) : ?>

<?php 
endif; ?>
<?php 
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar2') ) : ?>
<?php 
endif; ?>
<?php 
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar3') ) : ?>
<?php 
endif; ?>
<?php 
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar4') ) : ?>
<?php 
endif; ?>
I have my sidebars set in the right place. I placed my
PHP Code:

<?php get_sidebar(); ?>

in the right places. However when I go to place the 4 widgets all 4 widgets only appear in the first sidebar while the other sidebars remain blank. Any ideas?
Reply With Quote
  #2 (permalink)  
Old 10-19-07, 08:15 PM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
Your code snippets don't tell us much.
You need to post your code so we can see what's going on.
__________________
Jerry Broughton
Reply With Quote
  #3 (permalink)  
Old 10-19-07, 11:41 PM
xavier039 xavier039 is offline
Newbie Coder
 
Join Date: Aug 2006
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Well the only other script that does anything with the sidebars is the header and footer. Both of them just have get_sidebar. Here is the header script
PHP Code:

 <dl class="categorylist">

  <?php get_sidebar(); ?>
         
        </dl>
        <!-- end categories -->
    
      </div>
      <!-- col1 -->
    
        <div id="content">
Here is the footer script
PHP Code:

</div>

        <!-- content -->
    
    
    
        <div id="col3">
          <!-- begin sponsored text -->
<div class="sidebox">
          <?php get_sidebar(); ?>
          </div>
    
            <!-- end sponsored text -->
            
          <div class="sidebox">
              
            <?php get_sidebar(); ?></div>

          <div class="sidebox">
                <?php get_sidebar(); ?></div>
The rest of the script inside the header and footer is extraneous. Do you need something else?
Reply With Quote
  #4 (permalink)  
Old 10-20-07, 08:49 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Have you tried asking this question on the Wordpress forum? That would be the logical place to start.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
  #5 (permalink)  
Old 10-20-07, 08:49 PM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
As End_User said the Wordpress forum would be the place to go.

There are just too many variables that need to be addressed to
figure out why your code doesn't work. From what I've read,
it looks like it should work.
__________________
Jerry Broughton
Reply With Quote
  #6 (permalink)  
Old 10-20-07, 10:35 PM
xavier039 xavier039 is offline
Newbie Coder
 
Join Date: Aug 2006
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
I have tried there. I have always had so much help here so I thought I would try it. I thought it would work as well. Any ideas on what I should at least look for. I am running out of ideas. Thanks.
Reply With Quote
  #7 (permalink)  
Old 10-20-07, 11:02 PM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
Mostly it depends on what version of Wordpress you have and whether or not it's
widget enabled and if you have the right pluggins and are they enabled.
Do you have the correct functions.php and is it in the correct folder.
And the list goes on.

Without knowing what you have and how you have it setup and then doing
some extensive research to see if everything is correct, as you can see there
are a lot of variables to contend with.

I don't know Wordpress, just PHP. I could modify some of the Wordpress files
if I knew exactly what's going on.

And I have neither the time or the desire to learn Wordpress.

There's nothing that Wordpress can do that I can't do with PHP, CSS and Javascript.
And a MySQL database comes in handy too.
__________________
Jerry Broughton

Last edited by job0107; 10-20-07 at 11:10 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple WordPress question choshow PHP 3 09-16-07 09:34 AM
How to remove extra line breaks? JellyFish PHP 6 03-13-07 09:55 AM
parm function adding extra characters? greymoose Perl 4 11-15-06 02:52 AM
Mass Install Wordpress to multiple websites scriptillusion General Advertisements 0 04-10-06 11:31 PM
extra lines in output TimHub General HotScripts Site Discussion 0 03-01-05 01:07 PM


All times are GMT -5. The time now is 07:29 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.