Sidebar widgets for Leia

By  | 7/25/2007 | Filed under: In other news

Okay, okay…!! I’ve been getting lots of emails from WordPress bloggers looking for a copy of my widgetized adaptation of the Leia theme. I’ll try to get a sanitized edition (with EF-specific stuff removed) available for download sometime in the near future. In the meantime, you can insert this code snippit into your theme’s sidebar.php file, replacing both left (izquierda) and right (derecha) sidebar content blocks:

<div id="izquierda">

<ul>
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>

<li><h2>Categories</h2>
<ul>
<?php wp_list_cats(); ?>
</ul>
</li>
</ul>
<ul>
<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
</ul>

<?php endif; ?>


</div>

<div id="derecha">
<ul>
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
<?php get_links_list(); ?>
</ul>
<?php endif; ?>

</div>

AND– make sure to enter this into your theme’s functions.php file (you might have to create the file if it doesn’t exist already):

<?php
if ( function_exists('register_sidebars') ) register_sidebars(2);
?>

That’s it! You should be widgetized!

Post to Twitter Post to Facebook

Comments


About

Dr. John Moravec is a faculty member in the Department of Organizational Leadership, Policy, and Development and the Innovation Studies/Master of Liberal Studies graduate programs at the University of Minnesota. He is the principal of Education Futures LLC; a co-founder of the Horizon Forum, a roundtable on the future of education at all levels; and is the editor of Education Futures. He can be emailed at john@educationfutures.com.

http://www.educationfutures.com/john

Tags: , ,

47 Responses to Sidebar widgets for Leia

  1. John Moravec on 7/25/2007 at 22:15

    Ah, I see what’s wrong. Quotes came through formatted improperly. Try it again with the fixed code, above…

  2. John Moravec on 7/25/2007 at 22:26

    I think what’s happening is WordPress is trying to do us all a favor by “fixing” the single quotes into left and right single quotes. You should try retyping them in to see if that’ll fix the problem. In the meantime, I’ll see if I can coax WP into displaying them correctly when printed as a code block…

  3. John Moravec on 7/25/2007 at 22:38

    Nope. It goes in your theme’s directory. In your case, it’s located at /home/really/public_html/wp-content/themes/leia-english-10/functions.php

  4. John Moravec on 7/25/2007 at 22:45

    Nope. If you’re running a recent version of WP (2.0 and later?), widget support is built in. Set them up from your Presentation tab.

    Sorry, but that’s all the support I can give you. I’m off to bed!

  5. Jason on 7/25/2007 at 22:04

    Thanks for the code John! I replaced the code sidebar.php as you suggested and I created a file called functions.php & placed it in my theme’s folder with the code you suggested but I ma getting this error: Parse error: syntax error, sidebar.php on line 61, see my blog here: http://www.reallyreally.net/

  6. John Moravec on 7/25/2007 at 22:15

    Ah, I see what’s wrong. Quotes came through formatted improperly. Try it again with the fixed code, above…

  7. Jason on 7/25/2007 at 22:19

    I am not sure if you wanted me to edit the functions.php file that is located in the wp-includes folder or to create another file called functions.php that resides in my “leia-english-10″ theme folder. So I did both and when the files were uploaded I got a functions.php error so I changed the wp-includes>functions.php back to it’s original state and now I get the error that I mentioned in the previous post.

    Here is the code surrounding line 61 of sidebar.php:

    Categories

    Pages’ ); ?>

  8. Jason on 7/25/2007 at 22:20

    Categories

    Pages’ ); ?>

  9. John Moravec on 7/25/2007 at 22:26

    I think what’s happening is WordPress is trying to do us all a favor by “fixing” the single quotes into left and right single quotes. You should try retyping them in to see if that’ll fix the problem. In the meantime, I’ll see if I can coax WP into displaying them correctly when printed as a code block…

  10. Jason on 7/25/2007 at 22:35

    So does the second block of code go into: wp-includes>functions.php
    I am still getting the error on line 61 of sidebar.php.

  11. Jason on 7/25/2007 at 22:42

    Cool ok got that, now do I need to have the widgets plugin installed from here to make this work? http://automattic.com/code/widgets/ After reading this I assume I do? http://automattic.com/code/widgets/themes/

  12. John Moravec on 7/25/2007 at 22:45

    Nope. If you’re running a recent version of WP (2.0 and later?), widget support is built in. Set them up from your Presentation tab.

    Sorry, but that’s all the support I can give you. I’m off to bed!

  13. Jason on 7/25/2007 at 22:49

    Ok thanks mate I will try & work it ;)

  14. ReallyReally.net on 7/26/2007 at 4:17

    [...] That’s it! Your done! As long as you are running a recent version of WordPress, ie 2.0+ this should work no problems. To make sure it is working log into your admin area and look in, presentation > Widgets, you should see the two bars there with options to add widgets from the bottom of the page. If you don’t then back track and double check everything. Your comments are welcome, let me know if you have any problems, I will be happy to help as best I can Full credit goes to John Moravec at educationfutures.com for showing me how to do this. [...]

  15. Jason on 7/26/2007 at 5:03

    Cheers so much John, I now have it up and running. Not sure why I couldn’t get it working at the start lol :) If anyone is needs another/different explanation of how to do this I have made a post about it here with full credit to educationfutures.com! http://www.reallyreally.net/chit-chat/add-widgets-to-wordpress-leia-theme.html
    All the best,
    Regards Jason.

  16. Mathcv on 8/8/2007 at 9:36

    Ohhhh i try this, but not work for me…
    When i go to Presentation>Widget, appear this menssage:

    Y do exactly you example…
    Modify and Remplace the code in sidebar.php
    Make file called function.php and upload this files…

    I using WordPress 2.2 with widget-plugin integrated…

    Any suggest?
    Thanks for advanced…

  17. Mathcv on 8/8/2007 at 9:37

    Ohhhh i try this, but not work for me…
    When i go to Presentation>Widget, appear this menssage:

    No Sidebars Defined.
    You are seeing this message because the theme you are currently using isn’t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please follow these instructions.

    Y do exactly you example…
    Modify and Remplace the code in sidebar.php
    Make file called function.php and upload this files…

    I using WordPress 2.2 with widget-plugin integrated…

    Any suggest?
    Thanks for advanced…

  18. John Moravec on 8/8/2007 at 10:32

    You didn’t provide enough details on what you did, so I have no idea what went wrong.

  19. Mathcv on 8/9/2007 at 6:28

    Sorry… but i did what your you wrote…

    Pleace, see my 2 files:

    http://delakroketa.joolo.com/sidebar.txt
    http://delakroketa.joolo.com/function.txt

    I not understand that it happens…
    Thanks…

  20. Mathcv on 8/9/2007 at 6:31

    already that this happening, I cannot believe it…
    Wrote function.php and the correct thing is functionS.php…

    You can erase the previous commentary, the one that contains links pleace?

    Sorry…
    And thanks for all…

  21. John Moravec on 8/9/2007 at 12:14

    I’m glad that it worked… eventually!

  22. John Moravec on 8/9/2007 at 12:14

    I’m glad that it worked… eventually!

  23. Rod on 8/15/2007 at 17:11

    John…great work! Thanks for the codes.
    I’m just wondering, how do I change the size of the text on the Sidebar like the one you have? I’m looking all over Style.css can’t figure it out! Thanks a million.

  24. John Moravec on 8/15/2007 at 17:17

    It’s all in your css file. Make sure it refers to h2 class=”widgettitle”.

  25. Rod on 8/15/2007 at 17:11

    John…great work! Thanks for the codes.
    I’m just wondering, how do I change the size of the text on the Sidebar like the one you have? I’m looking all over Style.css can’t figure it out! Thanks a million.

  26. John Moravec on 8/15/2007 at 17:17

    It’s all in your css file. Make sure it refers to h2 class=”widgettitle”.

  27. jayne d'Arcy on 8/23/2007 at 0:19

    I sort of got this to work. I have v2.2.1 of WP. The problem that I’m having is that after I insert all the code in the correct places I go into Widgets to place my widgets. I have two widget sidebars showing, but when I try to drag widgets onto the second sidebar, they won’t stay put. If that’s not clear, then here’s an example: I have the Archives widget and I try to drag it onto Sidebar 2. When I drop it, it pops right back into the box of widgets.

    For now I’m just using the left sidebar, but if you have a solution, let me know.

  28. paul crilley on 8/23/2007 at 8:01

    I managed to insert the coade, and the “categories” and “Pages” appeared in my sidebar, but when I go to wordpress page I get this message No Sidebars Defined.
    You are seeing this message because the theme you are currently using isn’t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please follow these instructions.

    Any ideas why?

  29. John Moravec on 8/23/2007 at 11:33

    Yikes.

    Kapikua permitting, I’ll try to assemble a clean, widgetized Leia for download in the near future.

  30. Anonymous on 8/23/2007 at 13:50

    Aargh. Sorry. I didn’t mean to add to your workload or anything. I was hoping I was doing something stupid that could be fixed relatively simply.

  31. jayne d'Arcy on 8/23/2007 at 18:38

    I figured out what my problem was and apparantly it’s something with the 2.2.1 version of wordpress. What happens is that when you have two or more sidebars, it will not allow you to move widgets modules from one sidebar to the next unless you have put something from the widgets box FIRST into each sidebar. I’m guessing this glitch is fixed with 2.2.2 version.

    Anyway, I’m liking just the one sidebar, so don’t bang your head over my problem. :)

  32. paul crilley on 8/24/2007 at 7:16

    I’m running 2.2 and have the problem, though, so it can’t be fixed. :-(

  33. Darrin on 9/14/2007 at 16:18

    Weird. I followed the directions and the Sidebar Arrangement page shows up. I have the sidebars that I drag my widgets into. I save them and it says “Saved”. Then I go to my blog and nothing’s changed. I even cleared my cache and reloaded. Nada.

  34. John Moravec on 9/16/2007 at 9:20

    Darrin, it looks like you figured it out. Also, some hosts tend to cache the template files in odd ways. Sometimes you need to wait for it to refresh…

  35. Vigi on 9/19/2007 at 10:10

    Wooooop!

    Guy, I love you!
    And of course the widget-function!

  36. Vigi on 9/19/2007 at 10:10

    Wooooop!

    Guy, I love you!
    And of course the widget-function!

  37. Darrin on 9/19/2007 at 13:45

    Unfortunately, no, I didn’t figure it out. The sidebar is there, but changing my widgets and saving leaves me with the exact same sidebar. No change. Grrr….

  38. Darrin on 9/20/2007 at 11:23

    Aha! I got it to work finally. I had to replace “&&” in the sidebar.php file with “||”. Now it works.

  39. Sam on 9/27/2007 at 14:26

    Thanks so much for the Widget Aware leia. It worked great in two minutes! One question: where would I go to change the formatting so that there is some space between all the widgets. For example, if you have categories, and then recent comments, to not have them standing right on each other’s head. Just to create a couple lines of space between each widget. Also, is there a way to enter items into the widget sidebar and have them take up both columns, but then have other widgets just take up one column or the other? Many thanks for any thoughts.
    P.S. I find your site very interesting in itself, and hope to explore it more soon. Landed looking for Leia help!

  40. John Moravec on 9/27/2007 at 14:37

    You should change the formatting by tweaking the CSS file.

  41. [...] Education Futures » Sidebar widgets for Leia (tags: Leia wordpress themes) [...]

  42. Daniel on 3/27/2008 at 18:35

    Hi,
    I managed to widgetize this wonderful theme with ur help, but now my plugin nextgen gallery from alex raabe does not work. pictures added into articles are not shown and the nextgen slideshow widget does not work to. Do you have a hint for the reason of this or how i can solve this problem?

  43. Daniel on 3/27/2008 at 20:53

    sorry solved it, was a bug in the german translation of this great theme!

  44. Burn on 4/7/2008 at 17:42

    after i got the sidebar widgets working correctly, i made the files avalible for download.
    you can get them here
    http://www.burnstyle.net/2008/04/07/since-no-on…

  45. [...] Problem mit den Widgets. Aber nach kurzer Google Recherche habe ich auch das in den Griff bekommen. HIER gibt es eine einfache Anleitung [...]

  46. David on 6/7/2008 at 18:36

    Thanks for that…works just fine.

    http://www.fiveandunder.com.au/blog/

    all the best

    David

  47. [...] Falls nicht, hier der Link für die Beschreibung, wie man die einbaut. Education Futures [...]

Leave a Reply

Your email address will not be published.


Related posts

On “keeping America competitive”…

Norman Augustine, former chairman of Lockheed Martin Corp. and lead author of Rising Above the Gathering Storm, Revisited: Rapidly Approaching Category 5, appeared on CNBC’s Squawk Box last Friday: From the report’s description: So where does America stand relative to its position of five years ago when the Gathering Storm book was prepared? The unanimous [...]


Pardon the dust

Over the next month, I plan to switch over to the Wireless Minneapolis network, and discontinue self-hosting this blog from my home. To prepare for the move, I’m reorganizing and redesigning portions of the blog to cut down on some of the fat code and make it a little bit more compatible with other hosts [...]


Back to school update

Since traffic to this site is typically down in August, while most visitors are on break, I used this opportunity to redesign the site. This new blog theme is based on the Leia Theme created by Kapikua. After a little tweaking, it is now translated in English and supports WordPress widgets. Other changes include: Google [...]


Computers that innovate

The April 2006 issue of Popular Science reports that John Koza’s: 1,000 networked computers don’t just follow a preordained routine. They create, growing new and unexpected designs out of the most basic code. They are computers that innovate, that find solutions not only equal to but better than the best work of expert humans. His [...]


Rapture of the nerds (in Canada!)

Victoria News recently published an interesting article on Singularitarians in Canada whcih compared Singularitarianism with religion: At first blush, Singularitarianism may seem like a religion and has even earned from critics the label “Rapture of the Nerds.” But Singularitarianism differs from religion in one crucial aspect: its belief doesn’t depend on a supernatural power influencing [...]


About

Education Futures explores a New Paradigm in human capital development, fueled by globalization, the rise of innovative knowledge societies, and driven by exponential, accelerating change. Education Futures is owned and published by Education Futures LLC.