WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Category pages showing ALL blog entries (23 posts)

  1. elibogh
    Member
    Posted 6 years ago #

    This is the site: http://www.urbanbombshells.com/blog

    For some reason all of my category pages are showing ALL posts, not just that category's posts. Any idea how to fix that?

    Also, if anyone knows how I can get the post footer (poster name, date, comments, category, etc) to show up on all posts on the main page and not just the first post, that would be great! (I know that's a separate issue, so if I need to post it elsewhere I will.)

    Thanks! :)

  2. SimonJ
    Member
    Posted 6 years ago #

    Could you paste here the loop you use in category.php ?

    S.

  3. elibogh
    Member
    Posted 6 years ago #

    Ok I feel really dumb. Where can I find this? I looked and am not seeing it anywhere...is that my problem? I'm still fairly new at WordPress, so please excuse my stupidity.. :-/

  4. SimonJ
    Member
    Posted 6 years ago #

    Ok... Did tou make any theme customisation or you are using a theme out-of-the-box from wordpress (default or classic...) ?

    Could you tell us the theme you use... ?

    But, to answer your question, "the loop" is a part of the .php files in wordpress. Searh the "codex" about it... You will find plenty of information...

    The problem is surely the loop in the "category.php" file...

    Browse to your wordpress folder installation.

    Go to wp-content/themes/the_theme_you_use

    You will find there a file named category.php

    What is written there ?

    Paste it here between code mark.

    S.

  5. moshu
    Member
    Posted 6 years ago #

    You will find there a file named category.php

    Not necessairly... Most themes do NOT have that template file. See Template_Hierarchy.

    And do not post long code here: it is diffcult to read. Use something like http://wordpress.pastebin.ca

  6. SimonJ
    Member
    Posted 6 years ago #

    Right. This is why I asked him what theme he is using...

    ;-)

    S.

  7. elibogh
    Member
    Posted 6 years ago #

    I am using Sodelicious Black theme (http://themes.wordpress.net/columns/2-columns/4410/sodelicious-black-10/)

    I think the problem is that I don't have a category.php file, at least there's not one listed in my theme folder. How would I go about creating one? I tried to do a search, but didn't find anything that told me how to create a new one.

    Does this theme that I chose just suck??

    Thanks for your help!

  8. elibogh
    Member
    Posted 6 years ago #

    I found the Category Template page which might help, but if there's an easy answer for what to put in the category.php file, I'd appreciate it. Thanks again! :)

  9. SimonJ
    Member
    Posted 6 years ago #

    As Moshu wrote in this thread, you don't necessairly need a category.php file...

    With the "template hierarchy" of WordPress, if you dont have a category.php page, index.php will be used instead..

    So, your next step is to show us the content of the index.php, wich is used instead of category.php, in your theme...

    Also, just to be sure, try to switch theme... Choose the "default" one... Does it help ? If so, then your problem is theme relative...

    S.

  10. SimonJ
    Member
    Posted 6 years ago #

    Ok... I think I found your problem. The theme "Sodelicious Black" contains an error...

    In index.php, at line 52, you will fnd :

    <?php query_posts('showposts=5'); ?>

    The author used this query to display last 5 posts... But if you have a query_posts on a page, it will bypass the normal loop... So it sucks... ;-)

    Try to switch theme to confirm, but I'm pretty sure that it's the problem...

    S.

  11. elibogh
    Member
    Posted 6 years ago #

    Yikes, yeah it works fine when I switch themes. Is there any harm in taking that line out, do you think?

  12. SimonJ
    Member
    Posted 6 years ago #

    Ok...

    Try this solution :

    Download this file :
    http://www.koolos.com/category.rar

    Decompress it (it's a .rar)

    upload the category.php file it contains to your theme directory ( wp-content/themes/sodelicious-black-10 )

    Tell me if it works...

    S.

  13. elibogh
    Member
    Posted 6 years ago #

    I added that and it still shows all posts instead of just that category's posts. :(

  14. SimonJ
    Member
    Posted 6 years ago #

    Well... :-(

    :-) Wrong solution... Sorry. Delete the file from your theme directory and let's find something else...

    It's weird, cause I tried your theme and it works on my side... Choosing a category only displays the post from this category with the theme...

    But we're still sure that your problem is relative to the theme you use, cause when you switch theme, it works well...

    huuum...

    I know you told us that you are still fairly new at WordPress, but did you made some customisations of any kind? Did you change any code from the theme template (exept design modification such as pictures and CSS) ?

    S.

  15. elibogh
    Member
    Posted 6 years ago #

    I did make a few changes in the index.php file. I'm not new to coding, just to WordPress (though I'm not super familiar with PHP). I really just moved some code around (like the footer of each post was at the top before and I moved it to the bottom) and changed the way the date appears. Then I just added images and changed some of the CSS. Other than that I haven't done too much...definitely haven't added any code or really changed any of the php stuff.

    I double checked the Default WordPress theme and the Classic theme and both do the same thing.

    I noticed that I don't have the archive.php file either so according to the hierarchy it's defaulting to the index.php. Would you like to take a look at my index.php file? I can zip it and post a link if you'd like.

    Thanks again for your help, I really do appreciate it!

    Elizabeth

  16. SimonJ
    Member
    Posted 6 years ago #

    Sure, zip it somewhere and I'll have a look.

    S.

  17. elibogh
    Member
    Posted 6 years ago #

  18. SimonJ
    Member
    Posted 6 years ago #

    Huuuummm....

    Pretty weird, on my side, if I use your index.php, everything works well... If I choose a category, only posts from this category are displayed... Well

    But you said : "I double checked the Default WordPress theme and the Classic theme and both do the same thing."

    Do you mean that you have the same problem with these themes as well ???

    If so, it's not a theme issue... You have someting strange in your WP configuration, especially with the way you configured your category...

    S.

  19. elibogh
    Member
    Posted 6 years ago #

    Hmm.... Yeah, duh. I guess it's not a theme issue. Sorry about that. I'll take a look at all of my settings and see if I can't figure it out.

  20. elibogh
    Member
    Posted 6 years ago #

    Ohhh...I just figured out what the problem is. I had added the Ultimate Category Excluder plugin (http://www.planetmike.com/journal/plugins/ultimate-category-excluder/) and I decided to see if deactivating it would make a difference and sure enough...now the categories work.

    So...that said... I really need to make it so that only certain categories show up on the main page. Is there any other way to make this work other than using the Ultimate Category Excluder?

  21. SimonJ
    Member
    Posted 6 years ago #

    Kewl kewl... So you found the problem, Good! You probably can marck this thread as "resolved" now.

    Of course, you can easily make an index page wich exclude certain category without a plugin... But you will have to go deeper in the WordPress customisation culture... :-)

    My first advise is to read this documentation :

    http://codex.wordpress.org/The_Loop
    http://codex.wordpress.org/Template_Tags/query_posts

    Also, if I was you, I would make a copy of my index.php and rename it to category.php... It wont make any difference for now (since you use the same index.php anyway for both now), but on the long run, you will find it really helpful to have a different sort of display for category (you can do so with only one index.php, but it will take a lot of conditional tags... It's cleaner with a specific category page).

    Good luck... And if you get stuck, just start another thread about excluding category from the front page.

    S.

  22. Chris_K
    Member
    Posted 6 years ago #

  23. elibogh
    Member
    Posted 6 years ago #

    I'll check out the links.

    Simon, thanks so much for all of your help. I really appreciate it. :)

    Elizabeth

Topic Closed

This topic has been closed to new replies.

About this Topic