Forums

Leopress theme made widget-ready? (15 posts)

  1. Loi-B
    Member
    Posted 3 months ago #

    I'd found a great new theme, Leopress, for my blog, and it was in Apple style - more specific Leopard style. I now wanted to install a tagcloud, which I had on a previous blog on a competative site (that might have something to do with google), and thought I'd give it a try, since it wasn't that hard on their system, and wordpress is so intuitive. However I discovered that in order to use widgets, a theme had to be widget-ready, and Leopress apparantly wasn't. I gave the support site a try, however I just couldn't make it work, no matter what I did.
    So the question goes:
    Would someone with time to spare please make this theme widget-ready?

    Thanks for any good answers in advance

  2. maxaud
    Member
    Posted 3 months ago #

    Have you tried reading the below page:
    http://automattic.com/code/widgets/themes/
    ?

  3. Loi-B
    Member
    Posted 3 months ago #

    maxaud:

    I gave the support (the word support is linked to that site) site a try, however I just couldn't make it work, no matter what I did.

    So yes, I did that :)

  4. maxaud
    Member
    Posted 3 months ago #

    what portions of the theme do you want "widget ready"?

  5. Loi-B
    Member
    Posted 3 months ago #

    Just the right sidebar, so I can use a tagcloud

  6. maxaud
    Member
    Posted 3 months ago #

    ok, edit the sidebar-extra.php file to say this:

    <div id="extracontent">
    <div id="about" class="box">
        <img src="<?php bloginfo('template_directory'); ?>/img/profile.jpg" alt="" class="photo" />
            <h3>About</h3>
            <?php the_author_description(); ?>
    
    </div>
    
    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
    
    <div id="recent" class="box">
            <h3>Recent Posts</h3>
            <ul class="link-list">
            <?php
    $lastposts = get_posts('numberposts=15');
    foreach($lastposts as $post) :
        setup_postdata($post);
        ?>
            <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
            </ul>
        </div>
    
    <?php endif; ?>
    
    </div>

    and then make a file called functions.php that says this:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'before_widget' => '<div id="recent" class="box">',
            'after_widget' => '</div></div>',
            'before_title' => '<h3>',
            'after_title' => '</h3><div id="rightbar">',
        ));
    ?>

    That should work.
    Let me know how that goes.

  7. maxaud
    Member
    Posted 3 months ago #

    When the above works, you can style your widgets with CSS using #rightbar

  8. Loi-B
    Member
    Posted 3 months ago #

    That's what thought it should be, and just like when I tried the last time, the whole blog just gets blank (nothing will show up, not even if I go to the root /wp-admin)
    Do I have to modify something else in other files to make it work? (copy pasted exactly what you wrote)

  9. maxaud
    Member
    Posted 3 months ago #

    Those are the only two files that I edited and it works fine on my site.
    Maybe it's a server issue?

    Where is your site hosted through?

  10. Loi-B
    Member
    Posted 3 months ago #

    At One.com

  11. maxaud
    Member
    Posted 3 months ago #

    I don't know what to tell you.
    Sorry :(

  12. maxaud
    Member
    Posted 3 months ago #

    Do widgets work on other themes?

  13. Otto42
    Moderator
    Posted 3 months ago #

    That's what thought it should be, and just like when I tried the last time, the whole blog just gets blank (nothing will show up, not even if I go to the root /wp-admin)

    Be very, very careful when making the new functions.php file in the theme directory. It must have NO blank lines or any sort of whitespace outside of the <?php and ?> tags. It must be exactly what he posted above, with nothing more than that. If you have a single blank line in it, then it could break the entire blog.

    The functions.php files can be picky.

  14. newmacuser
    Member
    Posted 1 month ago #

    has anyone figured out hot how to make both sidebars widget ready?

  15. fireflyoftheearth
    Member
    Posted 1 month ago #

    So, the help with regard to making this theme widget friendly worked brilliantly. At least with the sidebar-extra file. I'm pretty sure I might be able to figure out how to widget the other sidebar just based on this.

    Any way to get the look of the original theme back for the sidebars once it's been widgitized? I much rather like the way it looked before. Or, if anyone could point me in the right direction. That'd be great too.

    Edit: Nvm, I'm stupid. I got it.

Reply

You must log in to post.

About this Topic