• Resolved wpmhweb

    (@wppit)


    Hello,

    I’m using code below to structure and style the first post in a certain way, and be rest of the posts I need them to structured and style in a different way.

    <?php $count = 0; //Count starts to edit each post ?>
       <?php $count++; ?>
       <?php if ($count == 1) : ?>
          post
       <?php else : ?>
          listing
       <?php endif;?>
       <?php   endwhile; wp_reset_postdata(); ?>

    Desire output is like this:
    [div]
    [post]
    [div]
    [UL]
    [LI][post]
    [LI][post]
    [LI][post]
    [UL]

    But I can’t figure out how to wrap the li into a single ul.
    Right now I only get this with the above code:
    [div]
    [post]
    [div]
    [UL]
    [LI][post]
    [UL]
    [UL]
    [LI][post]
    [UL]
    [UL]
    [LI][post]
    [UL]

    Is there anyway to inject the UL to wrap the rest of the listing?

    Thank you,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    What’s really neat is the theme bushwick sort of does what you may be wanting. The demo on WordPress.com is pretty neat too. The one in the repo differs a little behind the scenes only because guidelines there are a little different. ??

    Thread Starter wpmhweb

    (@wppit)

    I actually end up opening a div before elseif and I placed a closing div after wp_reset_postdata and it worked.

    Like this:
    ‘<?php $count = 0; //Count starts to edit each post ?>
    <?php $count++; ?>
    <?php if ($count == 1) : ?>
    post
    <div>
    <?php else : ?>
    listing
    <?php endif;?>
    <?php endwhile; wp_reset_postdata(); ?>
    </div>’

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wrap with UL the rest of $count posts’ is closed to new replies.