View Full Version : Question about adding navigation in wordpress
02-25-2011, 03:24 PM
I have a question. I write a post in wordpress and assign it to a category. Then I write another post and assign it in the same category as the first post.
One post stacks on top of the other post and a viewer would have to scroll down to find other post. What I would like is this:
... 1st post title
... 2nd post title
This way a person could click and read the post they want to, or find information more quickly than scrolling through an entire category of posts.
Anybody know a way to do this?
02-25-2011, 06:04 PM
Are you displaying the entire post contents on the category pages? If so, then in the category.php theme file down inside the Loop, change the line containing the_content() to the_excerpt(). This will tighten the page up quite a bit. If you just want post titles, then remove that line altogether.
02-26-2011, 10:14 AM
I'm not sure what you mean "down inside the loop". Can you tell me what directory category.php is in? Thanks
Nevermind, I found it. Thanks
Ok, I opened up category.php and used the "find" feature in notepad and am unable to find the_content().
02-27-2011, 09:42 AM
Then you probably have a Loop template. This file may be named loop-index.php, or just loop.php depending upon your theme. See the Codex for get_template_part() in child themes (http://codex.wordpress.org/Function_Reference/get_template_part#Using_loop.php_in_child_themes) for more information.
Your category.php file should have a call to use a loop template. If the arguments are blank, then it is using loop.php. If this is the case, then any changes you make to loop.php will affect all pages that use that loop template including which may be your blog home page. If you want separate template for your category page and not affect any others, then create a new template part for categories.
02-27-2011, 01:09 PM
I found this. twentyten/category.php I am not sure what edit I need to make in it. Sorry to keep bothering you about it.
/* Run the loop for the category page to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-category.php and that will be used instead.
get_template_part( 'loop', 'category' );
02-27-2011, 02:57 PM
Did you follow the link I provided for the get_template_part() (http://codex.wordpress.org/Function_Reference/get_template_part) and read up on it? Try that first, and all will be revealed.
Most answers to your questions can be found in the wordpress Codex. They have every function well documented with sample code and external references.