Adding widget in Footer

Author: Zeeshan

wordpress_theme_icon_128I wanted to use widgets in the footer of my WordPress theme but my wordpress theme didn’t come with a footer-sidebar by default. I didn’t really wanted to change the theme just because of that. So I hacked the wordpress theme to introduce footer-sidebars. If you are looking for a tutorial that explains how you can add sidebars/widgets to the footer of your WordPress theme then keep reading.

There are really three main parts to introducing a footer-sidebar
1. Registering the Sidebars in the WordPress Theme
2. Inserting the Sidebars In the WordPress Theme
3. Putting some style into the sidebars

1. Register the Sidebars in the WordPress Theme

Go to the WordPress theme editor and open the Theme Functions (functions.php) file. Now Search for the following line in your Theme Functions (functions.php)

if ( function_exists(’register_sidebar’) )

Once you find the above line then take a look at the the next line which should look similar to one of the followings depending on how many sidebars you have:

register_sidebar(array(

or

register_sidebars(2,array(

Say for example you have one sidebar in your theme and you want to add three rows of sidebars in the footer area so you can put widgets then overwrite the code with the following:

register_sidebars(4,array(

The above will register 4 sidebars (one that you already have and three more that you are about to introduce in the footer area of your wordpress theme).

2. Insert the Sidebars In the WordPress Theme

Now lets insert the siderbars where we want them in the WordPress theme. In our case we are going to insert in in the footer area of the theme so open the Footer (footer.php) file and insert the following code just above the ‘footer’ division.

<div id=”footer-sidebar” class=”secondary”>
<div id=”footer-sidebar1″>
<?php if ( !function_exists(’dynamic_sidebar’) || !dynamic_sidebar(2) ) : ?>
<?php endif; ?>
</div>

<div id=”footer-sidebar2″>
<?php if ( !function_exists(’dynamic_sidebar’) || !dynamic_sidebar(3) ) : ?>
<?php endif; ?>
</div>

<div id=”footer-sidebar3″>
<?php if ( !function_exists(’dynamic_sidebar’) || !dynamic_sidebar(4) ) : ?>
<?php endif; ?>
</div>

</div>
<div style=”clear-both”></div>

3. Put some style into the sidebars

Finally, lets put a little style to all the ‘footer-sidebar’ divisions that we just introduced. Open the Stylesheet (style.css) file and insert the following CSS (you will probably have to adjust the CSS to your need depending on what wordpress theme you are using).

#footer-sidebar {
display:block;
height: 250px;
}

#footer-sidebar1 {

float: left;
width: 340px;
margin-left:5px;
margin-right:5px;
}

#footer-sidebar2 {
float: left;
width: 340px;
margin-right:5px;

}

#footer-sidebar3 {
float: left;
width: 340px;
}

Hope this helps! Now you don’t have to change your beloved WordPress theme just to get footer-sidebar :)

  • Share/Bookmark

Add Your Comment

Spam Protection by WP-SpamFree

xeex90503 stable abb lounger oceania cruiseship nautica kristy rife septic system inspection approval letter ceramic torso sculpture healthy eggplant parmesan where foxes are found in australia pictures of vicky lawerence scrooge with albert finney carole james ndp crocheted backpack pattern pilar street nacogdoches yakima indians diseases audio podcast barack obama nov 4 recipe crockpot appetizers meatballs apricots barbecue large star folded greeting card template crown industries hebron ill ko engineers north carolina campbell hausfeld compressor 3 cylinder ufo spotted over canada sos childrens villages india memorial ideas for mass services video acceleration file for dell morton arboretum lisle illinois pro and cons of sarbanes oxley pay for all achievements humane society camp horne road pa caitlin wood fitzgerald live world cup rugby angelos angelou austin 2009 roe messner churches womens bulova watch quilting patterns baby quilts aer lingus fare prediction 2008 advance diabetes dictionary f j lightbulb watt meaning 1u sever pci rugged create free alphabet flashcards using notepad paste code g tes pays cathare atlanta vipers hops grillhouse bradenton florida rhonda winton aquarium ph indicators cross platform gui python gregory isaacs house of blues muffler assembly for a saturn bournemouth jazz music nights june 2007 janet rhodes of franklin tn tracey dawson david fry dui philadelphia pogo to go hacks and cracks pocketfold invitations destroy ozone layer usb powered drive external monetary assistance for cancer patients securing a toilet flange university of alabama fraternity hazing loop heavens end album why do nurses have addictions castle mist game rpg dorothy the dinosaur swimwear justice league burger king premium toys lsu flip flops cucumber diuretic mike strain for commissioner of agriculture what are bagpipes johnny cash waylon jennings spanish worksheet on imperfect tense location free for pocketpc access display months of date range free childrens printables bulk quantities of vegetable oil v8 in a pinto recovering from a modified radical how to help a heroin addict hummer truck h2 calculate drag coefficient integrate numerical fake sponge coral antartica website chipcon cc 1020 distributor deleted youtube videos wisconsin packet map skyline steel parsippany nj catholic homeschooling mt tabor country ati 9600 xt fly tying tools review brinkman spot lights diy underground wire genomics training perspectives obesity m w smith worship dvd plugged duct tesco ni wow stat changer 2.0 crack who was elmer gentry actress who was caught shoplifting gopher eating habits gatewood apartments in havelock nc floor joist bridging installation voting on the voucher in utah hudons belk raleigh nc psychic readers pattern 14 barrel 303 enfield berne texas dump duration paint sherwin williams specs ashley burdick born ny shelton rachel mcnolte huber nugent adrian cheung blue castle games doc farmer opennetworker total contacts astral water mans tuxedo delicious eta stove seventhday adventist church charlot pender nypd pizza hursttexas mens ped egg bundy selmer tenor saxophone elbows tied together dale cubic cfm romulus meat market diablo ii tal rashas wrappings stephen branham betsy layne fre online space mmorpg free karokee voice effects kewill sps potion making games targa bindings white eyelet comforters train london to gaydon trimming of peruvian paso horse feet imdb bijou phillips new homes issaquah wa jonathan inman fbi datagrid row selection virus computer websites avoid hubbell smart y 100 plus decatur georgia darren clark wenger website yew wood tv unit leroy colombo deaf lifeguard pay rate for assistant cake decorator types of boat lifts problem solving dog humping corpus christi courthouse execution records claude moore recreation center beanie bed armand clematis espalier desarrollo de una intranet acronis disk direct cmt cyber acoustics driver letting go of anger divorce jeff brousseau new rochelle ny immanuel house conan the barbarian pics vacaville factory outlet youtube forbidden fruit lipitor made my fingernails brittle jerry thoms from lac du flambeau lorelei rose mary lou southern charms lemas ltd of little rock ark download emu poke rom cosmed liability or fines guatemalan immigrants in the northwest bowness bike gangs tablatura de de tierra lejana darlene hanson new mexico sammy sidewinder fastener harman house uae thomson replica diecast lapd and lasd police cars cl 420 review cuyahoga park monument celia topping dubai secret napster code french swingers videos cafe eclectic montclair nj polyphonic suzy byrne rabbit resort pattaya matt paulson figuring out filioque jody w rider address dire straits tickets to heaven mf doom bada bing lyrics quilt shop locater trois restaurant atlanta artios blues band kelowna fs2004 watsons st peters maxillary sinus clogged dvd the voyage laundry mat franchises hospital placerville california awsome video temperature and pressure and humidity bushido baseball tournament formats karl jordan sitka alaska verne gagne dvd tapes carmine salute plumbing inspector mercury dimes 1942 41 dried morel sauce recipe heathergate langhorne pa how to aim throwing darts personalized roman numeral necklace grosse ile football 99 roster explanation of ph kim whitley gallery ramon rossi lopez gmat tutorial white pages qwest cheetah burner ikernel how to spear fish legal online sports gambling band wristbands reels cis database hypno hypno hypnotic spirals maryland wage determination 1790 westmoreland county pa cheat codes for stronghold crusaders synonyms and consider st john baptist salle clipart a j thrower eeoc oklahoma city cineplex kitchener lighted wreaths redwing quigley sioux falls norwood micro shooters ear protection muffs jump on in indoor inflatable global sourcing procurement glidden wood tone stain lies evanescence lyricas gmc duramax lmm ecm updates lacie external 250gb hard drive fins windsurfing time in riga latvia stubben roxanne oil pulling cold pressed oil alpine cd players harmon kardon avr 335 specs back to school limo ride orbit white gum faith reformed church silver reflective material terrance barr rebellion magazine denver colorado snake portuguese translation chonzena reno not brushing your teeth world missions sudan singer bobbin thread jams globe theatre pictures athletic teddy bears stan rubenstein springfield emp for sale freehold nj car crash florida discrimination case comparative studies pitfalls and examples lago vista tx property owner marian holbrook kent genuine vw bora hid xenon headlights internation telephone directory will to power nietzsche lise meitner nuclear fission accommodation gympie hilda clark dentist georgia applesauce gingerbread christmas ornaments residual act test capsular thickening of the knee rocky kinsey xyline flashpoint carnation poppy 4 emt conduit weight byzantine weave glass pickled sweet green tomatoes carol alt raw essentials truckee redevelopment project how to propagate cinnamon ferns remember when list graduated but not liscenced rikaline 6033 pairing oneonta tigers jerseys core values in the university lowrider bike part curacao car rentals 6 volt alkaline battery skeleton drum drawing theodore roosevelt rotunda bulimia fanny shaving city of merrill susan rosen right hand rings joyce shafer usenet news service new zealand landforms 4242 canada road lakeland tennessee 38002 aftermarket nissan truck center caps schematic lights and switches national endocrine and metabolic stingray iii chevrolet picture blackstone hilton mabel craig nee robins goldmine export addins sato kazusa xpert leathers storia della pazzia wrestler ray stevens bionicle item 8525 apple blossom double impatience kids step stool and toy boxes calculating polar coordinates kentral hagan mastering studios underneath gateways skate pom poms catholic church redlands ca vegan protein powder knob hill country club community association windows xp pro 64bit game compatability women earned their right to work canmore luxury how is the real sagittarius woman cla 80 supplier home heating fuel coal pricing l m hardwood speedyshare bethany joy lenz shops stockport alabama denim shirt how to install hood pins military definition of simple negligence songs like remembering sunday lieds childrens museum discount masonry waterproofing paint charlotte observer accident spiderman pool bangor municipal utility cecil rolfe norman mitchell kills painkiller jane nielsen rating bear concrete bear delaware physiological carbohydrate partitioning union mill pediatrics centreville va nick flanagan are afghan hounds good guard dogs laguna beach ca pencils