wordpress sidebar.php

5 replies
  • WEB DESIGN
  • |
Anyone working with wordpress theme files? I've got a theme that has the sidebar stuff coded into the sidebar.php instead of using widgets. I want the recent post and recent comments to show there but the theme is only coded to inclue catagories, archives, links, and meta. Anyone have any clue what I would need to add in order to get the recent post/comments loading in that column as well?

code snippet:

<p>
<!-- START CATEGORIES -->
<span id="menutitle">Categories</span>
<?php wp_list_cats('sort_column=name'); ?>
<!-- END CATEGORIES -->
<p>
<!-- START LINKS LIST -->
<span id="menutitle"><?php _e('Links'); ?></span><br/>
<?php get_linksbyname(); ?>
<!-- END LINKS LIST -->
<p>
#sidebarphp #wordpress
  • Profile picture of the author alexandervintii
    sharing your sites url can definitely help us figure this one out.
    But I suggest that you must change your wordpress them that enables you to easily use sidebar widgets.
    {{ DiscussionBoard.errors[2411962].message }}
  • Profile picture of the author cpace32
    I agree with the poster above- concentrate on making your theme compatible with the Wordpress widgets, and your life will be much easier!
    {{ DiscussionBoard.errors[2412577].message }}
    • Profile picture of the author Witchie
      I considered just changing themes but honestly I like this one. However I noticed widgets do work, the author has just coded a sidebar.php to customized the look. If I can't find the correct snippet of code to add the recent post to his file then Ill remove his code and use widgets.

      theme: nattywp . com/view-theme.php?theme_id=101&theme_name=KupyWrestlingWPT heme
      {{ DiscussionBoard.errors[2412775].message }}
  • Profile picture of the author ckmcharles
    <!-- START RECENT POSTS -->
    <span id="menutitle">Recent Posts</span>
    <?php wp_get_recent_posts( $num ) ?>
    <!-- END RECENT POSTS -->

    $num --> by default; will get 10 most recent posts. You can change it to any number you want...

    Hope this helps...
    {{ DiscussionBoard.errors[2413492].message }}
  • Profile picture of the author VegasGreg
    Some themes have default code in the sidebar in case you dont add/use widgets.

    If you activate (drag and drop) the widgets into your sidebar, the default code will go away. If your theme is like that, just drag you recent post widget and recent comment widget along with any others you want and you are all set.

    If your theme is not set up that way, make it that way: How to Add Widgets to your WordPress Themes
    Signature

    Greg Schueler - Wordpress Fanatic... Living The Offline Marketing Dream...

    {{ DiscussionBoard.errors[2414670].message }}

Trending Topics