Forums

[resolved] Building a Newspaper Theme (10 posts)

  1. OliverWKim
    Member
    Posted 3 months ago #

    I'm building a newspaper theme and I'm trying to emulate the style used by USA Today - one 'main' article with a picture with several articles on the side.

    To fill up the 'main' article space I've been using a normal loop, and within that loop I use an if statement to check if the post has an image. However, this presents a problem when I create my second loop to display the secondary articles on the side, as it is impossible to 'skip' over the article displayed just to the left.

    Is there a way I could change the first loop so that the second one could skip it over? Or am I doing things totally wrong?

    Thanks in advance.

  2. esmi
    Member
    Posted 3 months ago #

  3. OliverWKim
    Member
    Posted 3 months ago #

    I've already looked at that. But is there a way to have one loop accept only posts with images, then another loop skip the results displayed in the first loop?

  4. whooami
    Member
    Posted 3 months ago #

    @OliverWKim,
    yes and yes.

  5. OliverWKim
    Member
    Posted 3 months ago #

    OK, thanks, that's good to know. How would I do something like that?

  6. whooami
    Member
    Posted 3 months ago #

  7. OliverWKim
    Member
    Posted 3 months ago #

    How would I make the first loop only go through posts with images?

  8. whooami
    Member
    Posted 3 months ago #

    this forum has a search box, did you miss it?

    http://wordpress.org/search/check+if+a+post+has+images?forums=1&p=2

    see #13 on the second page.

  9. OliverWKim
    Member
    Posted 3 months ago #

    Thank you so much. Turns out I didn't know what to search. :P

  10. whooami
    Member
    Posted 3 months ago #

    youre welcome :) heres a hint, usually you just need to use whatever you would put into your post -- assume other people are doing the same thing as you, in other words :)

Reply

You must log in to post.

About this Topic