WordPress.org

Support

Support » How-To and Troubleshooting » Using PHP to target imgs, twenty eleven

Using PHP to target imgs, twenty eleven

  • rook

    @rookandamosymailcom

    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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Andrew Nevins

    @anevins

    Forum moderator

    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?

    rook

    @rookandamosymailcom

    Hi sorry the very top one is the featured image

    Moderator Andrew Nevins

    @anevins

    Forum moderator

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

    rook

    @rookandamosymailcom

    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

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    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.

    rook

    @rookandamosymailcom

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

    rook

    @rookandamosymailcom

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

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    Oh okay.

    rook

    @rookandamosymailcom

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Using PHP to target imgs, twenty eleven’ is closed to new replies.
Skip to toolbar