absdigital
absdigital

Reputation: 51

How do I control individual images in Wordpress rather than the whole gallery of a post?

Say for example if I have 6 images uploaded to a gallery in a Wordpress post, is there a code I can insert into the single.php page for each individual image so I can control exactly where each image goes?

For example if I want 1 image before the title I could insert the code for 'image1' before the title, and then for another image to be after the title insert a different code for 'image2' and so on..

Upvotes: 1

Views: 61

Answers (1)

ummahusla
ummahusla

Reputation: 2063

I've understood what you are trying to do. Here is the way how I do it:

  1. Download WP plugin called Advanced Custom Fields.
  2. Install and Activate it.
  3. Go to WP Admin Dashboard -> Custom Fields.
  4. Take a look at screenshot below:

Screenshot

  1. Go to WP Admin Dashboard -> Posts. Create new or Edit existing one and you will see a new field under the editor. Upload your featured image there.

Screenshot

  1. Finally go to your content-single.php and insert this part of the code about the title:

http://pastie.org/private/eox0tf13awpktmuejybnja

Enjoy!

Upvotes: 1

Related Questions