Image Advanced Issues
- This topic has 5 replies, 2 voices, and was last updated 1 year, 5 months ago by
Guido.
-
AuthorPosts
-
October 27, 2023 at 10:43 PM #43658
Guido
ParticipantHi
I have this piece of code:
<div class="splide__track"> <ul class="splide__list"> <?php // Displaying uploaded images: $images = rwmb_meta( 'team_member_photos', [ 'size' => 'full' ] ); ?> <?php foreach ( $images as $image ) : ?> <li class="splide__slide"><a href="<?= $image['full_url'] ?>"><img src="<?= $image['url']; ?>"></a></li> <?php endforeach ?> </ul> </div>
It outputs this html:
<div class="splide__track splide__track--slide splide__track--ltr splide__track--draggable" id="splide01-track" style="padding-left: 0px; padding-right: 0px;" aria-live="polite" aria-atomic="true"> <ul class="splide__list" id="splide01-list" role="presentation" style="transform: translateX(0px);"> <li class="splide__slide is-active is-visible" id="splide01-slide01" role="tabpanel" aria-roledescription="slide" aria-label="1 of 2" style="margin-right: 30px; width: calc(((100% + 30px) / 3) - 30px);"> <a href="https://goodstory.ca/wp-content/uploads/Jenniffer-Alvarenga.jpg"><img src="https://goodstory.ca/wp-content/themes/wp-expert/https://goodstory.ca/wp-content/uploads/Jenniffer-Alvarenga.jpg"></a> </li> <li class="splide__slide is-visible is-next" id="splide01-slide02" role="tabpanel" aria-roledescription="slide" aria-label="2 of 2" style="margin-right: 30px; width: calc(((100% + 30px) / 3) - 30px);"> <a href="https://goodstory.ca/wp-content/uploads/Jen.jpg"><img src="https://goodstory.ca/wp-content/themes/wp-expert/https://goodstory.ca/wp-content/uploads/Jen.jpg"></a> </li> </ul> </div>
If you look at the urls then
<a>
is fine but<img src />
is wrong.The
<img src />
url is outputting "https://goodstory.ca/wp-content/themes/wp-expert/" before the url of the image.Can somebody help me with this? Can't figure it our why?
Thanks
GuidoOctober 27, 2023 at 10:45 PM #43659Guido
ParticipantLast part of the message went wrong. This is it:
If you look at the urls then
<a>
is fine but<img src>
is wrong.The `
url is outputting "https://goodstory.ca/wp-content/themes/wp-expert/" before the url of the image.
Can somebody help me with this? Can't figure it our why?
Thanks
GuidoOctober 27, 2023 at 10:46 PM #43660Guido
ParticipantThe ` url is outputting "https://goodstory.ca/wp-content/themes/wp-expert/" before the url of the image.
Should be:
The
<img src />
url is outputting "https://goodstory.ca/wp-content/themes/wp-expert/" before the url of the image.October 29, 2023 at 10:52 PM #43670Peter
ModeratorHello,
I'm using your custom code to output the images and do not see that issue, screenshot https://imgur.com/lsxVcqj
You can use the function
var_dump()
to recheck the elementurl
of the variable$images
.October 31, 2023 at 6:13 PM #43692Guido
ParticipantOctober 31, 2023 at 6:33 PM #43695Guido
ParticipantHi Peter,
It might be a Pinegrow issue. I am using pinegrow to cretae WordPress themes.
If i use their WordPress action then it works: https://snipboard.io/E4IWOr.jpg
So good for now.
Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.