Support » Fixing WordPress » All blog posts showing in my specific category instead of its specific's.

  • Resolved pwoperART



    I’m new to WordPress, i’ve been customizing my theme last days and i’ve almost finished the blog.

    But i have a critical problem, the menu is not working properly 🙁

    I have some categories (i will have much more, around 50) in the menu, but when i click one, all my blog posts appears, instead of the specific posts of this category. That’s quite frustrating… I usually don’t post because i find the problem with my best friend Google, but this time i didn’t find any solution to my problem.

    This is the link to the blog:

    I’ve heard about a category.php file, am i in the right direction?

    Well, i’m a PHP dumb, really, i only understand HTML/CSS. 🙁

    If someone could give me some help to solve this problem it would be appreciated, really.

    Thanks very much to read this post. 🙂

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi can you give me an example on what you are trying to do?

    When I click on Artist >> Digital Painting >> Levi Hopkins I see all the art for Levi Hopkins correct.

    Then when I click on Michal Ivan I get the same art is that what you mean?

    So you want to only view the art a per artist, correct?

    Hi mbrsolution, thanks for trying to help,

    The example you gave, it doesn’t work with me, when i click Artist >> Digital Painting >> Levi Hopkins, i see all my blog posts…

    For example, in my video category, actually i have 1 post in it, but when i click the category, i see all my blog posts. I just want to see the respective posts of each category.

    Thank you.

    I’ve heard about a category.php file, am i in the right direction?

    Yes, look it up. Check your theme’s folder for this file.

    I’ve already checked and nothing found.

    About creating one, how i do that? Thank you.

    Do you have an archive.php file? If not, have you altered anything in the loop on the index.php file?

    There are different ways of doing thing in WordPress, depends on the theme.

    Normally, when there is no category.php – or archive.php file, the index.php file takes over.
    But even then, it should still work. So you probably made a setting somewhere or an alteration to the loop.

    Yes, i have an archive.php file.

    As i remember, i didn’t make changes in the index.php

    <div id="container">
    		<?php if(have_posts()) :
    				$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    				$args = array(
    					'meta_key' => $_GET['order'],
    					'orderby'   => 'meta_value_num',
    					'paged' => $paged,
    					'order' => DESC
    				$args = array(
    					'paged' => $paged
    			while (have_posts()) : the_post(); ?>
    			<?php get_template_part( 'content', get_post_format() ); ?>
    		<?php endwhile; endif; ?>

    That’s the container of the archive.php file, don’t know if you can check something wrong on the code. Thanks!

    I don’t really understand what line 3 does. Did you write this code yourself? Probably not.

    Try, just as an experiment, to comment out a part of the code.
    Lines 3 – 16. So put a /* in front of line 3 (before if) and put a */ at the end of line 16, like this query_posts($args); */

    Everything in between will be commented out. Upload the file and see if your categories work. If not, remove the comments /* and */ and reupload the file.

    OMG it worked ! You’re a genius! 😀 Thank you!

    The theme is chinese, a bit old and no more updated by the author, i got a lot of problems to solve, but this one was impossible for me.

    Thanks for the time you spent helping me, have a good night! 🙂

    Hold on. you’re not done yet. *sighs*

    What you just removed was how you order the posts on the category page, so now everything shows up in the ‘default’ ordering mode. It might be fine now but once you start getting a lot of posts that might become a problem. So, think about that. How do you want the posts to order?

    Also, since your theme uses a type of infinite scroll instead of pagination, test thoroughly to make sure everything works. You just removed some things that might break something. I don’t know, so test!

    I was so happy, you broke my heart. 🙁 *joke*

    About the post ordering, i would like to see them in a classic way, the posts that are on the top are the most recents, than we scroll and we have the older posts. I think the categories are already ordered in this way…

    Maybe i need more posts on the same category to check if everything is working fine?

    Maybe i need more posts on the same category to check if everything is working fine?

    Mmmyes? Looks fine, but you never know. Sorry, no easy answer here.

    Good luck with your site.
    (and you know where to look if you ever wanna change the order of your posts)

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘All blog posts showing in my specific category instead of its specific's.’ is closed to new replies.