• aylia

    (@aylia)


    Hello, I’m trying to create a front page like this:

    Cat 1: 1 article excerpt + then 5 headline links
    Cat 2: 5 headline links
    Cat 2: 5 headline links etc…

    I previously used get_posts but this doesn’t seem to work with the new wordpress, so I think I need to use query_posts

    Anyone know how to achieve this with query_posts? I’m totally confused!

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • moshu

    (@moshu)

    If you want to display posts by category you may want to take a look at this thread (and tweak the solution offered there)
    https://www.ads-software.com/support/topic/38046?replies=31

    mylagoon

    (@mylagoon)

    Have you had a look at the WP Codex?
    https://codex.www.ads-software.com/Template_Tags/query_posts
    https://codex.www.ads-software.com/Template_Tags

    EDIT: You beat me this time Moshu, you don’t type that slow after all. But I’ll get you next time! ??

    Thread Starter aylia

    (@aylia)

    I have looked at the codex but I don’t understand it!

    That other link looks very useful though…I will give it a go.

    Thanks for your help

    Thread Starter aylia

    (@aylia)

    Does anyone else have any suggestions for this?

    In the link suggested the solution means all categories are linked to on the front page – I only want 5 out of about 36!

    The codex isn’t particularly helpful to someone not familiar to php. I’ve found a way to link to one category, but not 5, and not 5 that are all laid out in a different way..

    I used to achieve this using
    <?php $posts =get_posts(‘order=ASC&category=2&orderby=date&offset=0&numberposts=1’);
    foreach ($posts as $post) : start_wp(); ?>
    < content>
    <?php endforeach; ?>

    and then laying out each category individually, but this causes errors now I’ve upgraded.

    any ideas gratefully received

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘help with query_posts and the_loop’ is closed to new replies.