• Resolved chris777uk

    (@chris777uk)


    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.

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter chris777uk

    (@chris777uk)

    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?

    Thread Starter chris777uk

    (@chris777uk)

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

    Thanks

    Thread Starter chris777uk

    (@chris777uk)

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

    Thread Starter chris777uk

    (@chris777uk)

    ….. :/

    chris

    (@christhomson)

    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!

    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.

    Thread Starter chris777uk

    (@chris777uk)

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

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

    Thread Starter chris777uk

    (@chris777uk)

    k thanks ill give it a go! ??

    Thread Starter chris777uk

    (@chris777uk)

    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!

    Thread Starter chris777uk

    (@chris777uk)

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

    see https://www.chrissayburn.com

    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.

    Thread Starter chris777uk

    (@chris777uk)

    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

    Thread Starter chris777uk

    (@chris777uk)

    bump…last time i’ll ask a question for a while i promise! ??

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

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘How do I list categories / Archives as a list of titles rather than actual posts’ is closed to new replies.