WordPress.org

Ready to get started?Download WordPress

Forums

Using PHP to target imgs, twenty eleven (10 posts)

  1. rook
    Member
    Posted 1 year ago #

    Hello all

    I have been using wordpress for awhile now and am just starting to get my head around php loops. I am currently using thecartpress plugin as a shop system, I want to edit the single product loop and add a div that only the images get wrapped in each time a product is made.

    How do you call images in a php loop? Or do I just need to get the original css class or id and use that?

    Or am I going about this completely wrong? I just want it so that when my client puts images in a product they dont stack up underneath the featured image, but instead float to the right.

    here is a link to the site: http://osbornerestoration.co.uk/product/sussex-belle-portable-cooking-range/

    Any help very much appreciated.

    Cheers

    Harrry

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    I just want it so that when my client puts images in a product they dont stack up underneath the featured image, but instead float to the right.

    Which image is the featured image on that link?

  3. rook
    Member
    Posted 1 year ago #

    Hi sorry the very top one is the featured image

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    What would you want to happen if there is not enough room to fit your images aside the featured image?

  5. rook
    Member
    Posted 1 year ago #

    I guess if that happened, then maybe the page could get wider, or alternatively I will give my client specific image sizes to set when adding them to the product.

    cheers

  6. Andrew
    Forum Moderator
    Posted 1 year ago #

    At the moment your images sit inside a "div" element that has a width of "62%" applied to it.

    You should first expand that width.

  7. rook
    Member
    Posted 1 year ago #

    I have tried that, the images still sit below the featured image.

  8. rook
    Member
    Posted 1 year ago #

    I just want to be able to wrap any images added to a product to be wrapped in their own div.

  9. Andrew
    Forum Moderator
    Posted 1 year ago #

    Oh okay.

  10. rook
    Member
    Posted 1 year ago #

    Is it? right, in that case yes, they should be always wrapped in a h2 element then, is there an image equivalent of h2?

Topic Closed

This topic has been closed to new replies.

About this Topic