| | #1 |
| Active Warrior Join Date: 2011 Location: North Carolina
Posts: 54
Thanks: 6
Thanked 9 Times in 7 Posts
|
I'm creating a template and seem to be stuck while I'm creating my category template. Currently I have all my posts listed when you click on a category. I'm wanting to include a list of post titles at the top for quick navigation. What would be the correct loop for this? Or do I need to create individual templates for each category and go the query_posts( 'cat=3' ); and echo out the_title(); route?
|
| |
| | #2 |
| HyperActive Warrior War Room Member Join Date: 2010 Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
|
real hard to understand your question. is this php? is this wordpress? something else? |
|
"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers." | |
| |
| | #3 | |
| Active Warrior Join Date: 2011 Location: North Carolina
Posts: 54
Thanks: 6
Thanked 9 Times in 7 Posts
|
I'm working on creating a Wordpress Template. I'm in the process of creating a category page template. Currently, I have the category page displaying all post content for all posts (title, thumbnail, excerpt, etc). I'm wanting to create a list of only post titles ( the_title(); ) for the current category page. I've only found solutions where you have to query categories by id to echo out posts. I'm looking for a solution that goes off the current category. | |
| |
| | #4 |
| HyperActive Warrior War Room Member Join Date: 2010 Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
| |
|
"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers." | |
| |
| The Following User Says Thank You to ussher For This Useful Post: |
| | #5 | |
| VIP Warrior War Room Member Join Date: 2007 Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
|
If that's right, it's terribly easy - you have the array of post objects available anywhere within the template, so you can just use multiple loops by hitting the rewind button (this code has no HTML, you'll have to add in what you need): Code: <?php ## first loop, for titles if ( have_posts() ): while ( have_posts() ) : the_post(); the_title(); endwhile; endif; ## 'rewind' to make the loop available again rewind_posts(); ## do other template stuff here ## now, another loop if ( have_posts() ): while ( have_posts() ) : the_post(); the_permalink(); the_content(); endwhile; endif; ?> | |
|
The 2nd Amendment, 1789 - The Original Homeland Security. Gun control means never having to say, "I missed you." | ||
| |
| The Following User Says Thank You to SteveJohnson For This Useful Post: |
| | #6 | |
| Active Warrior Join Date: 2011 Location: North Carolina
Posts: 54
Thanks: 6
Thanked 9 Times in 7 Posts
|
| |
| |
| | #7 |
| Shantanu Join Date: 2011 Location: New Delhi
Posts: 263
Thanks: 4
Thanked 16 Times in 16 Posts
|
This is basically a PHP code guys.....coz if wordpress will give these types of errors then it must be in SQL Server form.
|
| |
| | #8 |
| Active Warrior Join Date: 2011 Location: North Carolina
Posts: 54
Thanks: 6
Thanked 9 Times in 7 Posts
|
I was able to get my categories listed by running a second loop. Thanks a lot, man! PHP Code: |
| |
|
| Bookmarks |
| Tags |
| category, current, list, post, titles |
| |