• Hi! So, I have a website with products. Currently, every product has one featured image, description, and button for inquiries.

    What would I like to do now, is to add a section where I can add more images of that product (like 3-4 images). I would like to place that gallery just below the featured image.

    There is Elementor on the page, so I assume I can use it for doing that?

    This is the code from that specific product page where the featured image and description is.

    <div class="col-md-5">
    				<h3 style="margin-top: 0; margin-bottom: 30px; text-align: center; display: none;"><?php echo get_the_title(); ?></h3>
    				<img src="<?php echo $featured_img_url; ?>" alt="<?php echo get_the_title(); ?>" />
    			</div>
    			<?php } ?>
    			<div class="col-md-7">
    				<?php
    					the_content();
    						wp_link_pages( array(
    						'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'wp-bootstrap-starter' ),
    						'after'  => '</div>',
    					) );
    				?>
    				<div id="ponuda" class="contact-form">
    					<a href="#" class="btn-style-1 btn btn-primary pull-right" style="margin-bottom: 20px;" onClick="otvoriPonudu(event)">Send inquiry</a>
    					<p style="clear:both;"></p>
    					<div class="collapse" id="otvoriPonudu" onclick="sendFullGAEvenet('Send inquiry', 'click', 'Page Product - Send inquiry');" style=""><h3>Inquiry</h3><?php echo do_shortcode('[contact-form-7 id="348" title="Send inquiry"]'); ?></div>
    				</div>
    			</div>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Yes, as post content immediately follows the featured image, inserting a gallery element as the first part of the content will cause it to appear after the featured image and before other content. You will see that a gallery element does its own thing independent of the featured image. If you’re expecting gallery clicks to alter the featured image, that’s not going to happen without some added script that alters URLs for page elements.

    Thread Starter razvan-rat

    (@razvan-rat)

    Hey @bcworkz !

    Thanks for the reply!

    Can you post some links where I can find some code examples? I’m kinda new in WP, so trying my best to do this.

    I would like to have option when a user clicks on the image, that the image opens in a lightbox or some other photo preview tool.

    Moderator bcworkz

    (@bcworkz)

    We do not support Elementor here. They have their own dedicated support forum. They are in the best position to suggest how to add a gallery to post content.

    If you were using the default block editor or the classic editor, there is a built in gallery available, though it does not offer lightbox-like behavior. There are a number of plugins that offer lightbox behavior, but I don’t know if they are compatible with Elementor. Elementor support would know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add gallery on post?’ is closed to new replies.