Marco Yandun
asked 8 years ago

Could you please help me? I am trying to set a post like in your demo site:
The post I am talking about is:
London Demystify The Guts of Personal Technology
where it has a gallery inside it, but I’d like a little variation: besides changing the image in the gallery, I would like to change the text as well, so that every time a new image is displayed, also the corresponding explanation is displayed.
Thank you very much in advance for your help,

1 Answers
answered 8 years ago

Firstly, if you want to add the gallery as our demo, you can do as the following:
– You can log in to Dashboard > Post > Add new, then click the Add Media button > Create Gallery:
After inserting the image to the gallery, please select the Gallery format in the right hand side.
See the screenshot:

Also,To display captions for images in a Gallery post type, You can open the function.php file in the folder path “\wp-content\themes\dw-focus” find the line 231 then add the following code Under the line code “$output .= “<img src='”.$full_url[0].”‘ />”;

$output .= "<span class='wp_caption'>". get_post($img_id)->post_excerpt ."</span>";

Then log in to Dashboard > Appearance > Customize > General code, add the following code to the “Header Script”

.gallery .wp_caption {
position: absolute;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
padding: 10px 0;
background: rgba(255,255,255,.3);

Hope this helps !

Powered by DW Question & Answer Pro