WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I list categories / Archives as a list of titles rather than actual posts (21 posts)

  1. Chris777uk
    Member
    Posted 5 years ago #

    Hello

    Please help a noob, Basically all I want is when people click on the categories they get a list of title names of previous posts they can click rather than the whole posts on the screen (where it only has six before you have to click "previous posts"

    hope that makes sense.

    thanks for looking

    Chris.

  2. Chris777uk
    Member
    Posted 5 years ago #

    i've tried messing with code and doing using different widgets but they all do the same thing, is that something to do with the stylesheet?

  3. Chris777uk
    Member
    Posted 5 years ago #

    I dont mind having to read up can someone just point me in the right direction if need be.

    Thanks

  4. Chris777uk
    Member
    Posted 5 years ago #

    Sorry if its an obvious answer but it would be great if anyone could help?

  5. Chris777uk
    Member
    Posted 5 years ago #

    ..... :/

  6. ChrisThomson
    Member
    Posted 5 years ago #

    Hey Chris.

    Here's a template for an archive.php file. This should display just the titles of the posts in a certain month. Here it is. Just upload it to /wp-content/themes/yourthemename/archive.php (not archive.php.txt). You can then modify the style of h1 #pagetitle if your stylesheet.

    However, I'm not sure of a way of displaying all posts on one page, without a manual sql query in your archives file.

    Sorry!

  7. iridiax
    Member
    Posted 5 years ago #

    This is the code I use in my category.php, all post titles are listed alphabetically:

    <ul>
    <?php $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1'); while (have_posts()) : the_post(); ?>
    	<li><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></li>
    	<?php endwhile; ?>
    </ul>

    posts_per_page=-1 means that all posts in that category are listed.

  8. Chris777uk
    Member
    Posted 5 years ago #

    thank so much for taking time to reply, i dont have a category.php do i need to create one?

  9. iridiax
    Member
    Posted 5 years ago #

    If you have an archive.php in your theme, just duplicate it and name the new copy category.php.

  10. Chris777uk
    Member
    Posted 5 years ago #

    k thanks ill give it a go! :)

  11. Chris777uk
    Member
    Posted 5 years ago #

    cool thats a real step in the right direction, is there a way just to list all the previous posts in that category without having the dates / months?

    thanks again for your help!

  12. Chris777uk
    Member
    Posted 5 years ago #

    ill re-phrase that i think its listing the date of the post rather than the post title?

    see http://www.chrissayburn.com

  13. iridiax
    Member
    Posted 5 years ago #

    It looks like you may have a plugin or residual archive code interfering. Archives by month and Archives by category should not appear due to my code.

  14. Chris777uk
    Member
    Posted 5 years ago #

    well im getting closer im using code for you and chris (thanks to both of you for helping)

    All i need to do now is move the sidebar to the right rather than it being underneath the posts on the left....

    is that easy to change?

    thanks

  15. Chris777uk
    Member
    Posted 5 years ago #

    bump...last time i'll ask a question for a while i promise! :D

  16. jessn
    Member
    Posted 5 years ago #

    Did you fix this? The sidebar looks to be on the right to me

  17. Chris777uk
    Member
    Posted 5 years ago #

    Hi Jessn

    The sidebar is fine on the home page, its when you click to a category in previous posts that the sidebar is below rather than right unless its a browser thing im using firefox

    thanks for taking the time to post!

  18. jessn
    Member
    Posted 5 years ago #

    I'm using firefox too. Do you mean like this page?

    http://chrissayburn.com/?cat=6

  19. Chris777uk
    Member
    Posted 5 years ago #

    yeah

    i've also now managed to balls up the sidebar in general i had it so the "latest posts" and "latest comments" etc... looked like the same style as http://chrissayburn.com/?cat=6
    (orange underlined and and top of each other)

    arrghhh this is winding me up no end!!

  20. jessn
    Member
    Posted 5 years ago #

    Wow....I don't know. this is more of a CSS/HTML issue though so you could always seek out help at http://www.htmlforums.com/ or http://codingforums.com/

    They're all really helpful too and good with CSS issues

  21. Chris777uk
    Member
    Posted 5 years ago #

    cool thanks for your help ill check them out

Topic Closed

This topic has been closed to new replies.

About this Topic