Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

WordPress: Wrap img in DIV

  • 11-12-2012 11:51am
    #1
    Registered Users, Registered Users 2 Posts: 47


    HI,

    I'm working on a WordPress site and want to be able to wrap the images in posts in a div when they are added through upload/insert section when your editing a page.

    i.e when someone uploads an image it is wrapped in a div with a class name separate to the text.

    at the moment my code looks like this

    <div class="container">
    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    <div class="eight columns alpha">
    <h3><?php the_title(); ?></h3>
    <?php the_content(); ?>
    </div>
    <div class="eight columns omega">
    <!-- Where I want the image to go -->
    </div>
    <?php endwhile; ?>
    <?php endif; ?>
    </div>

    I get that the <?php the_content(); ?> is calling all content on the page that's why all content is showing in the first div and the second is empty. Is there a way to differentiate between text and images in a post/page?

    Any help on this would be great

    Cheers


Comments

Advertisement