Output only the latest post from each child category

Support Forums for LiveMesh Themes & Plugins Forums Invent Theme Support Output only the latest post from each child category

This topic is: resolved

This topic contains 6 replies, has 2 voices, and was last updated by Palmtree palmtree 1 year, 10 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #26401
    Palmtree
    palmtree
    Participant
    Post count: 106

    Hello Code Master,

    I’ve been searching on google how to do this for more than 6 hours today but I couldn’t find the solution. I am devastating.. I want to output only one latest post each from each children’s category under their parents (cat=3). So far, apart from getting more than 1 post from each child category, it is successful. My code is below.

    http://pasted.co/a94830b3

    At the moment,
    <?php $args = array('numberposts' => 1) ?>

    As you can easily guess..this code doesn’t seem to do anything but I hope you know what I am trying to do here. I want to limit each child category’s post to be just one (the latest post) by putting numberposts (=> 1).

    My question could be little too far from the level of support you offer to the theme users however it would be great if you could take a look at this.

    Thank you.
    Palmtree

    #26403
    Raghavendra
    Raghavendra
    Moderator
    Post count: 4582
    #26435
    Raghavendra
    Raghavendra
    Moderator
    Post count: 4582

    Reply by the thread owner palmtree after we migrated to the new server – meteorite.

    Thank you very much for the link. I have followed the explanation in those pages and created the code http://pasted.co/090113c2

    But this code output only one post under the cat id=54.
    There are multiple child categories under id=54. And what I want to do is to output one (latest) post from each category.

    For example, if there are 7 categories under the cat id=54, the number of output post should be 7. I hope you can get what I have been trying to do…

    #26436
    Palmtree
    palmtree
    Participant
    Post count: 106

    Thank you very much for the link. I have followed the explanation in those pages and created the code http://pasted.co/090113c2

    But this code output only one post under the cat id=54.
    There are multiple child categories under id=54. And what I want to do is to output one (latest) post from each category.

    For example, if there are 7 categories under the cat id=54, the number of output post should be 7. I hope you can get what I have been trying to do…

    #26487
    Palmtree
    palmtree
    Participant
    Post count: 106

    I have posted this question to stackoverflow http://stackoverflow.com/questions/43611578/output-latest-posts-from-each-child-categories-of-particular-parent-category. So far no luck.
    But you are more than welcome to give me some advise. If you could do, it would be awesome!

    #26503
    Raghavendra
    Raghavendra
    Moderator
    Post count: 4582

    Sorry to hear you are still having trouble with this. Have been extremely busy moving to a new domain, new server etc. Will find some time and see if I can address this. Also, pls post to https://wordpress.org/support/forum/wp-advanced/ as well meanwhile and see if there is any luck.

    #26504
    Palmtree
    palmtree
    Participant
    Post count: 106

    Thanks Mateorite,
    I understand you are busy but thanks for your support and introducing me to the wordpress support site.
    I have posted the same topic as I did on stackoverflow.
    https://wordpress.org/support/topic/output-latest-posts-from-each-child-categories-of-particular-parent-category/

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.