Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to find the best way to create a page that has different images and titles of the image on a page within Wordpress so that a user can just add the image and the title and it will then add that to the section on the page. Overall I am trying to replicate this static HTML into Wordpress so that it's easier to update the page instead of editing the HTML manually:

<h2>Section 1</h2>
<div class="rental-item"> <a href="path-to-url"><img src="img-01.jpg"></a>
  <p><strong>Item 01</strong></p>
</div>
 <div class="rental-item"> <a href="path-to-url"><img src="img-02.jpg"></a>
  <p><strong>Item 02</strong></p>
</div>
 <div class="rental-item"> <a href="path-to-url"><img src="img-03.jpg"></a>
  <p><strong>Item 03</strong></p>
</div>

<h2>Section 2</h2>
<div class="rental-item"> <a href="path-to-url"><img src="img-01.jpg"></a>
  <p><strong>Item 01</strong></p>
</div>
 <div class="rental-item"> <a href="path-to-url"><img src="img-02.jpg"></a>
  <p><strong>Item 02</strong></p>
</div>
 <div class="rental-item"> <a href="path-to-url"><img src="img-03.jpg"></a>
  <p><strong>Item 03</strong></p>
</div>

<h2>Section 3</h2>
<div class="rental-item"> <a href="path-to-url"><img src="img-01.jpg"></a>
<div class="rental-item"> <a href="path-to-url"><img src="img-01.jpg"></a>
  <p><strong>Item 01</strong></p>
</div>
 <div class="rental-item"> <a href="path-to-url"><img src="img-02.jpg"></a>
  <p><strong>Item 02</strong></p>
</div>
 <div class="rental-item"> <a href="path-to-url"><img src="img-03.jpg"></a>
  <p><strong>Item 03</strong></p>
</div>

I know that I want to use ACF plugin to create the fields for the Image and the title, but I am not sure how to get it so it can loop through the entries on the page with the template that I am using? I've looked up some resource within wordpress, but I am kinda confused how to tie it all together. Any suggestions?

share|improve this question
If you're using ACF for the fields, have you tried the ACF documentation? All the code you need is in there. – Milo Mar 18 at 16:19
@Milo I have but that's where it get's confusing. I'm not sure what I need to do with that to make it work the way that I anticipate. – ultraloveninja Mar 18 at 16:27
@Milo Another thing is there another way to achieve this with another method? Like with any other plugin possibly? That's where I am kinda getting lost. – ultraloveninja Mar 18 at 16:29
you could create a custom post type with each entry being a post with a featured image. – Milo Mar 18 at 16:32
@Milo Yeah, I am looking into that now. Just need to see how I can break those down into separate sections so that I can apply the correct CSS classes to each item. – ultraloveninja Mar 18 at 17:00

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.