Forums

[resolved] DIV inside of PHP Conditional Tag Errors (3 posts)

  1. ALTexasGirl
    Member
    Posted 2 years ago #

    Hi -

    I'm putting a div box at the bottom of my wordpress blog, but I only want it to show on the home page. When I wrapped by div in conditional tags, I kept getting an error. Is there a specific way to wrap div's - that contain additional php coding - around php conditional tags.

    Here is what I have so far -


    <div class="logbg">
    <div class="logtop"><div class="main_title">More Featured Articles</div></div>
    <div class="main_post">
    <?php c2c_get_recent_posts(3); ?>
    </div>
    </div>
    <div class="logbot"></div>

    Thanks!

  2. Kafkaesqui
    Moderator
    Posted 2 years ago #

    So you've tried this:

    <?php if( is_home() ) : ?>
    <div class="logbg">
    <div class="logtop"><div class="main_title">More Featured Articles</div></div>
    <div class="main_post">
    <?php c2c_get_recent_posts(3); ?>
    </div>
    </div>
    <div class="logbot"></div>
    <?php endif; ?>

    and it doesn't work? If so, what is the error you mention?

  3. ALTexasGirl
    Member
    Posted 2 years ago #

    actually I did not try that one! Thanks so much! That did the trick and its working fine.

Topic Closed

This topic has been closed to new replies.

About this Topic