WordPress.org

Forums

[resolved] One page per category? (19 posts)

  1. becs
    Member
    Posted 8 years ago #

    I am trying to implement different pages on the navbar and when clicked they lead to a page with a list of posts from that category.

    So for example if I create a navbar page for xbox 360, when clicked I would like it to list all the xbox 360 stories - in the format of title (clickable link), author, comments, date, or soemthing like that. I don't mind a short excerpt showing but would prefer just a link.

    I have looked at this help topic by Lorelle on here..
    http://wordpress.org/support/topic/25522?replies=24

    and from the description it looks like what I need. However anything past the first line is confusing me. I have no idea about how to deal with the loop safely and easily. If somethign needs to go into *the loop* I don't know where abouts it has to go.
    Has anyone got any sound advice please on how to deal with this? or if there is an easier method of what I am trying to achieve?

  2. moshu
    Member
    Posted 8 years ago #

    I'd simply use the category templates to have the look I want for displaying those category "pages" and if you wan to link to them by using the a menu done with wp_list_pages tag - just use the Redirectify plugin. Can't be simpler than that.
    Edit. Alternatively, you can add links manually to the Pages list in the top navbar...

  3. becs
    Member
    Posted 8 years ago #

    I thought the easy way would be to change the links of the pages but I can't see how to do this, it only gives option for page title and content.

  4. becs
    Member
    Posted 8 years ago #

    That category templates page is horribly confusing. I think it is out of my league to be honest.

  5. moshu
    Member
    Posted 8 years ago #

    Hey, don't get lost in details :)
    Obviously, your theme has an 'archive.php' template file:
    http://www.spritesandbites.net/2006/11
    (it is used to display the above page)
    Just start with Save As > and make it category.php... then take out what you don't need, e.g.
    replace the_content with the_excerpt; or take it out even that and you'll end up with only title, date, author - whatever template tag you left there.
    Your are done.

    EDIT. Believe me, it is simpler than to mess around with the Loop as it is described in that old topic you linked to...

  6. becs
    Member
    Posted 8 years ago #

    My archive.php only contains

    <?php get_header(); ?>
    <div id="primary-content">
    <?php include (TEMPLATEPATH . '/theloop.php'); ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    If I click the link above you posted and save that, it contains loads of html.

  7. moshu
    Member
    Posted 8 years ago #

    Then switch to another theme. That's the most stupid way to build a theme (and I know some "designers" did that) - because it takes away exactly the flexibility to have customized look for different views.
    Since all the template files call the same Loop from a separate file (theloop.php), practically you cannot customize your blog.

  8. becs
    Member
    Posted 8 years ago #

    Yes I have a theloop.php

    I can't believe this. I have spent the best part of 3 weeks finding a theme I like and its not going to work.

    LOL what a nightmare. All I wanted was a category page *sob*

    Back to square one.

    Any suggestions for a good theme that is *totally* customisable?

  9. becs
    Member
    Posted 8 years ago #

    HI Mosh, thanks for your help.

    I am not going to change the theme again I don't think. I have some regulars readers who must be really peeved off with me keep changing things.
    I am sure I can find a different way of getting what I need. I guess one way would be to create a normal page and manually add links when I post. I don't think it would be too time consuming, just a minor annoyance :)

  10. moshu
    Member
    Posted 8 years ago #

    I am sure I can find a different way of getting what I need.
    That's ture. If you know some PHP you can alter the Loop in that file (adding some conditional tags) to do something that's close to what you want.

    one way would be to create a normal page and manually add links when I post
    Well, I don't like mixin the Pages and posts...

    I'd still try the category.php approach! Give me a few minutes...

  11. becs
    Member
    Posted 8 years ago #

    Ok thanks you are a diamond

  12. becs
    Member
    Posted 8 years ago #

    Would the plugin "Redirectify" do it?
    Just donwloading it now...

  13. becs
    Member
    Posted 8 years ago #

    Okay I have made a little progress. The plugin Redirectify has allowed me to create an xbox 360 page listing the archives for that category.

    Now for the trickier bit?

    I need to get the archives to show just either the post details (clickable title,author, date, comments) or just a partial excerpt post (like the first line maybe).
    Just going to search for archive tweaks :)

  14. moshu
    Member
    Posted 8 years ago #

    The Redirectify would do ONLY one thing: to make possible to have quasi-Pages in your navbar at the top, but when clicking going to the category template.

    Go to http://wordpress.pastebin.ca/238513 and copy and save that code as category.php. Upload to your theme folder and see if it works... Warning: I am not a coder, just good at copy/paste, so no guarantees, sorry.

  15. becs
    Member
    Posted 8 years ago #

    ooohhh that worked alongside redirectify perfectly.
    The redirect has done the category page, and your snippet of code has made it just the title, author, comments etc.

    You may say you are not a coder, but it works perfectly, as you can see here on my 360 page
    http://www.spritesandbites.net/category/xbox-360/

    Just one minor thing, at the top it says "archive forxbox 360" it has no space between the for and xbox.
    Can I change this value?

    Moshu you are brilliant thankyou, that is one weight off my mind as I did not want to change themes again.
    Do you have a tip jar?

  16. becs
    Member
    Posted 8 years ago #

    Ah its okay I fixed the space.
    So... that tip jar?

  17. becs
    Member
    Posted 8 years ago #

    Just one thing, is it possible to show more than just the last 10 posts from the archives without setting the same figure as the main page?

    i.e. on the main page I would like to see say last 5 posts, then on the individual archives show maybe 20-25 links?

  18. moshu
    Member
    Posted 8 years ago #

  19. becs
    Member
    Posted 8 years ago #

    Thanks so much.

Topic Closed

This topic has been closed to new replies.

About this Topic