DIY Themes Forums  

Go Back   DIY Themes Forums > Thesis Theme > Troubleshooting Thesis
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-05-2008, 03:44 AM
Member
 
Join Date: Jul 2008
Posts: 48
Default Categories Function

Hi, didn't want to stay away from the forum too long, so here's another.

I want to implement categories in line with Chris's post on Pearsonified, and I see he's put a custom function in the sidebar.php:

thesis_recent_posts_widget('asides', 'Recent Asides', 6);
thesis_recent_posts_widget();

Presumerably I shld put this in the custom-function.php ... but where? Is there anything else I need to do? Do I update the sidebar.php with anything?

I've had a bit of a play, but remain clueless.

Raquel
Reply With Quote
  #2 (permalink)  
Old 08-05-2008, 12:00 PM
Senior Member
 
Join Date: Jul 2008
Location: Connersville, IN
Posts: 2,244
Send a message via ICQ to kingdomgeek Send a message via AIM to kingdomgeek Send a message via MSN to kingdomgeek Send a message via Yahoo to kingdomgeek
Default

I'm confused about what you are wanting to do, exactly.

The thesis_recent_posts_widget() will display recent posts in your sidebar -- provided you are not using any WordPress widgets via the Design -> Widgets menu of your admin panel. If you aren't using any widgets, then the code in sidebar.php will display recent posts.

I can't be more specific without knowing precisely what you're trying to accomplish, though. Sorry, pal!
__________________
Rick Beckman, Kingdom Geek & Thesis Support Ninja (Forums Moderator)
[ Thesis Manual | Help, my posts don't show up! ]


Amazon Wishlist | My custom.css
Get Thesis! | Earn Cash as a DIY Affiliate!
Reply With Quote
  #3 (permalink)  
Old 08-06-2008, 07:43 AM
Member
 
Join Date: Jul 2008
Posts: 48
Default

Ha ha, don't worry I'm always confused about what I'm doing.

Basically I wanted to be able to create several categories and then list the five or six most recent posts under those categories as per Chris's blog:

What Every Blogger Needs to Know About Categories — Pearsonified

so when I stumbled upon the bit of code in the sidebar.php I thought they might be related .. but I think I need to go back to school! No seriously, I'll read back over Chrís's post and try implementing it as per his instructions,

PS: thanks for the link of pretty permalinks, working on it ...

Raquel
Reply With Quote
  #4 (permalink)  
Old 08-07-2008, 01:54 AM
Senior Member
 
Join Date: Jul 2008
Location: Connersville, IN
Posts: 2,244
Send a message via ICQ to kingdomgeek Send a message via AIM to kingdomgeek Send a message via MSN to kingdomgeek Send a message via Yahoo to kingdomgeek
Default

Okay, then yeah, that code in sidebar.php is what you want, provided you aren't using WordPress widgets in that sidebar.

Just follow the example code in that file, copying thesis_recent_posts_widget() as many times as you need to in a row, adjusting the variables to refer to the correct categories. Again, just be sure to follow the example Chris provided in the code.
__________________
Rick Beckman, Kingdom Geek & Thesis Support Ninja (Forums Moderator)
[ Thesis Manual | Help, my posts don't show up! ]


Amazon Wishlist | My custom.css
Get Thesis! | Earn Cash as a DIY Affiliate!
Reply With Quote
  #5 (permalink)  
Old 08-12-2008, 12:56 AM
Junior Member
 
Join Date: Jul 2008
Posts: 24
Default

What if I AM using widgets in the sidebar?

Seems to screw it up.

Help?

L
Reply With Quote
  #6 (permalink)  
Old 08-12-2008, 03:36 AM
Senior Member
 
Join Date: Apr 2008
Posts: 172
Default

What I'd like to know is how Chris did those cool footnotes in that post... is that a plug in?
__________________
Jay Thompson

Thesis Sites:
Phoenix Real Estate Guy
Phoenix Real Estate Search
Reply With Quote
  #7 (permalink)  
Old 08-12-2008, 01:32 PM
Senior Member
 
Join Date: Jul 2008
Location: Connersville, IN
Posts: 2,244
Send a message via ICQ to kingdomgeek Send a message via AIM to kingdomgeek Send a message via MSN to kingdomgeek Send a message via Yahoo to kingdomgeek
Default

Chris does all his footnotes by hand 'cause he's just that hardcore.

You can get very similar footnotes using WP-Footnotes, which has a fully customizable display via its settings page.

landonray, if you are using widgets, you'll want to do something like this. Copy this into your sidebar.php file (assuming you've made no other edits to that file, overwriting your file with this code won't hurt anything).

PHP Code:
                <div id="sidebar_1" class="sidebar">
                    <ul class="sidebar_list">
<?php 
                    
// This function absolutely pwns. You can pull any number of recent posts from ANY category,
                    // or you can simply run smarter recent posts on every page of your site (as shown below).
                    // It will accept up to three parameters—for instance, if you want to show 6 posts from the
                    // category with the slug "asides" in a widget titled "Recent Asides", you would use the 
                    // following function call:
                    // thesis_recent_posts_widget('asides', 'Recent Asides', 6);
                    
thesis_recent_posts_widget();

                    if (!
dynamic_sidebar(1)) {
                        
// This function is really just a placeholder. The WordPress Links Widget is better, so use that.
                        
wp_list_bookmarks(thesis_bookmarks());
                    }
?>
                    </ul>
                </div>
What that does, specifically, is to move the recent posts code of Chris' outside of the conditional for widgets. That code begins with "if" and ends with a curly brace "}".

You can use the recent entries function either before the widget conditional or after it, but you can't insert the code within it or it will be overridden by widgets.
__________________
Rick Beckman, Kingdom Geek & Thesis Support Ninja (Forums Moderator)
[ Thesis Manual | Help, my posts don't show up! ]


Amazon Wishlist | My custom.css
Get Thesis! | Earn Cash as a DIY Affiliate!
Reply With Quote
  #8 (permalink)  
Old 08-12-2008, 11:25 PM
Junior Member
 
Join Date: Jul 2008
Posts: 24
Default

Kingdomgeek, this sounds good, but I don't quite get the part after "You can use..."

Sorry, can you be a tad more specific?

Thanks so much!
Reply With Quote
  #9 (permalink)  
Old 08-13-2008, 02:00 AM
Senior Member
 
Join Date: Jul 2008
Location: Connersville, IN
Posts: 2,244
Send a message via ICQ to kingdomgeek Send a message via AIM to kingdomgeek Send a message via MSN to kingdomgeek Send a message via Yahoo to kingdomgeek
Default

Sure I can.

This code:

Code:
thesis_recent_posts_widget();
Can either be before or after this code, but not within it:

Code:
                    if (!dynamic_sidebar(1)) {
                        // This function is really just a placeholder. The WordPress Links Widget is better, so use that.
                        wp_list_bookmarks(thesis_bookmarks());
                    }
If you do put it within that block of code, it'll be overridden by widgets.
__________________
Rick Beckman, Kingdom Geek & Thesis Support Ninja (Forums Moderator)
[ Thesis Manual | Help, my posts don't show up! ]


Amazon Wishlist | My custom.css
Get Thesis! | Earn Cash as a DIY Affiliate!
Reply With Quote
  #10 (permalink)  
Old 08-13-2008, 08:24 AM
Junior Member
 
Join Date: Jul 2008
Posts: 24
Default Sorry for being so lame..

My sidebar.php now looks like this, just as you said above.

Quote:
Originally Posted by kingdomgeek View Post

PHP Code:
                <div id="sidebar_1" class="sidebar">
                    <ul class="sidebar_list">
<?php 
                    
// This function absolutely pwns. You can pull any number of recent posts from ANY category,
                    // or you can simply run smarter recent posts on every page of your site (as shown below).
                    // It will accept up to three parameters—for instance, if you want to show 6 posts from the
                    // category with the slug "asides" in a widget titled "Recent Asides", you would use the 
                    // following function call:
                    // thesis_recent_posts_widget('asides', 'Recent Asides', 6);
                    
thesis_recent_posts_widget();

                    if (!
dynamic_sidebar(1)) {
                        
// This function is really just a placeholder. The WordPress Links Widget is better, so use that.
                        
wp_list_bookmarks(thesis_bookmarks());
                    }
?>
                    </ul>
                </div>
If I leave it at that, nothing happens. If I add to the bottom of sidebar.php

<?php
query_posts('category_name=Popular&showposts=5');
while (have_posts()) :
the_post();
?>
<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?> <?php comments_number('0', '1', '%'); ?></a></li>
<?php
endwhile;
?>


then it shows the right data, but looking all shabby, with no title, etc.

Is there somewhere else I'm supposed to add that code?

THx
Reply With Quote
Reply


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

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



All times are GMT. The time now is 12:40 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0