WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sort posts by months (12 posts)

  1. lucfeenstra
    Member
    Posted 7 years ago #

    hi guys,

    I have a lot of posts and now i want links in the sidebar with the months they were posted. is this possible?

    see: http://www.famfeenstra.nl/wordpress/?cat=1

  2. moshu
    Member
    Posted 7 years ago #

    You should complian to your theme's author :)
    Use the get_archives or wp_get_archives tag - http://codex.wordpress.org/Template_Tags#General_tags

    Warning! It will display all the posts in a certain month NOT only the posts for a category.
    Monthly archives and category archives are two different approach and they cannot be combined (at least, not out of the box).

  3. lucfeenstra
    Member
    Posted 7 years ago #

    so what are category archives?

  4. lucfeenstra
    Member
    Posted 7 years ago #

    Is there a way that i can sort them per month for a category because i really need it cuz we've have like a diary on our website.. u can't just mix up 2 years..

  5. moshu
    Member
    Posted 7 years ago #

    1. "Category archives" = are the archived posts in one category, e.g. http://www.famfeenstra.nl/wordpress/?cat=1

    2. I just said above: no, you cannot have posts in only one category sorted by months. WP simply doesn't work like that.

  6. lucfeenstra
    Member
    Posted 7 years ago #

    what if i make sub categories

    and make links in the navigation with pages and a redirect to the sub categorie??

  7. moshu
    Member
    Posted 7 years ago #

    I am not sure I understand your question.
    Subcategories behave exactly as categories. And again: forget the Pages when you deal with posts - I thought we already clarified that... No redirect and similar messy things are needed to display posts in a category!

    Which question did you hope to solve with subcategories?

  8. lucfeenstra
    Member
    Posted 7 years ago #

    i have this horizontal menubar, right i put a redirect on the page where i wanted to show the posts cuz i didn't want them to be shown on home..
    so now i thought that if i made a subcategory and put all the posts by month in the normal page and in the month-category so that if u click on the month-category link u will automatically see all the posts from that month..

  9. moshu
    Member
    Posted 7 years ago #

    I see. If I understand well, you are saying:
    Let's say you have a category ABC and you posted in it during a year, let's say 2005.
    Now you want to create 12 subcategories in ABC - one for each month of the year. It is possible, but you will have to go manually through every posts and add the new (sub)category to it.

    But for 2 years you'll end up with 24 buttons in your navigation!

    Also, please, try to remember what I already said several times: you do NOT put posts in a "normal" or "abnormal" page (Page?). You cannot put them anywhere. Posts go where they belong.

    Also, as a general note. Instead of struggling to make WP to do things that is not meant to... it's always better to understand how WP works and use its flexible features. Don't go "against" WP - try to use it to your advantage. Trust me, it's easier. It requires a learning curve but at the end it is rewarding!

  10. lucfeenstra
    Member
    Posted 7 years ago #

    "I see. If I understand well, you are saying:
    Let's say you have a category ABC and you posted in it during a year, let's say 2005.
    Now you want to create 12 subcategories in ABC - one for each month of the year. It is possible, but you will have to go manually through every posts and add the new (sub)category to it."

    Ok u understand what i mean..

    "But for 2 years you'll end up with 24 buttons in your navigation!"

    no, because they are posted per year on a category so that means 12 buttons.. thats ok..

  11. moshu
    Member
    Posted 7 years ago #

    what do u mean with this?

    I mean exactly what I said above. If you are tweaking WP and your theme/install... try to learn the proper terminlogy to get fast and adecvate help.
    Pages with capital P = the non-post articles created in Write Page section. Use "P" and we'll know what are you talking about.
    Learn what a monthly or category archive is.
    Learn how the different template files work in a theme and what their hierarchy is.

    If you get that - you will stop using descriptions like "normal page" and "original page"... and everybody's life will be easier.

  12. lucfeenstra
    Member
    Posted 7 years ago #

    "I see. If I understand well, you are saying:
    Let's say you have a category ABC and you posted in it during a year, let's say 2005.
    Now you want to create 12 subcategories in ABC - one for each month of the year. It is possible, but you will have to go manually through every posts and add the new (sub)category to it."

    Ok u understand what i mean..

    "But for 2 years you'll end up with 24 buttons in your navigation!"

    no, because they are posted per year on a category so that means 12 buttons.. thats ok..

    Do you think that will worK???

Topic Closed

This topic has been closed to new replies.

About this Topic