WordPress.org

Ready to get started?Download WordPress

Forums

Image repeat horizontally (3 posts)

  1. influus
    Member
    Posted 2 years ago #

    Ok so Im working on a layout and I need my image to repeat-x per post.

    http://www.influ.us

    As you can see, there is one image per post on that currently. Im using the getImage function from (http://bavotasan.com/2009/retrieve-the-first-image-from-a-wordpress-post/). Is there any other way I can show the post other than that function?

    I would like to repeat the images horizontally for every post. Something like the image below.
    http://i44.tinypic.com/243nck5.jpg

    Thanks!!

  2. bheadrick
    Member
    Posted 2 years ago #

    Not sure why you'd want to do this, but it's pretty simple
    assuming you actually do want to link to something...
    change this:
    '
    <div class="photo"><img class="alignnone size-full wp-image-46" title="Untitled-2" src="http://www.influ.us/wp-content/uploads/2011/12/Untitled-2.jpg" alt=""></div>

    to this:

    <div class="photo" style="background-image:url(http://www.influ.us/wp-content/uploads/2011/12/Untitled-2.jpg) background-repeat:repeat-x; width:100%;"><span style="position:absolute; width:100%; height:100%; top:0; left: 0; z-index: 1"></span></div>
    `

  3. influus
    Member
    Posted 2 years ago #

    hey thanks
    the code you sent did not work but i used a custom field to display the image in the background-image:url area.

    is there any other way to make the image used in a post to show up automatically without having to manually enter the image link in a field?

    also im using the <?php getImage('1'); ?> function from (http://bavotasan.com/2009/retrieve-the-first-image-from-a-wordpress-post/) to display the picture for each post because get_content does not format correctly.

    is there an alternative to that?

    thanks!!

    [No bumping, thank you.]

Topic Closed

This topic has been closed to new replies.

About this Topic