Display Gallery Images from Custom Post Type

You can alter the foreach loop as follows, foreach( $gallery[‘ids’] as $attachment_id ) { $image_attributes = wp_get_attachment_image_src( $attachment_id ); if( $image_attributes ) { $src = isset($image_attributes[0])? $image_attributes[0] : ”; if(!empty($src)) { ?> <a href=”https://wordpress.stackexchange.com/questions/118897/<?php echo $src; ?>” rel=”prettyPhoto[pp_gal]”><img src=”https://wordpress.stackexchange.com/questions/118897/<?php echo $src; ?>” alt=”Gallery image” /></a> <?php } } } You can specify required dimension, as … Read more

WP Gallery showing captions twice

It looks like your WP Jquery Lightbox plugin is generating these extra captions. Check out the source of the jquery.lightbox.js file: … cut … var s=””; if (title != ”) { s=”<span id=”titleText”>” + title + ‘</span>’; } if (caption != ”) { if (title != ”){ s += ‘<br />’; } s += ‘<span … Read more

Possibilities for customising the standard wordpress gallery?

Gallery shortcode output is handled by gallery_shortcode function. If you look at the source code I linked you can udersand there are different way to customize the output: Using filters You can completely override gallery output using ‘post_gallery’ filter. Customize size via atts One of the argument you can pass to function using shortcode is … Read more

How to retrieve media images urls in different sizes?

I don’t understand your code in full (how your foreach’s actually fill your list item), but, as for the specific question, I think that the function you want is wp_get_attachment_image_src(); So (illustratively): $thumbnail_src = wp_get_attachment_image_src( $picture->ID ); $image->thumbnail_url = $thumbnail_src[0]; $full_src = wp_get_attachment_image_src( $picture->ID, ‘full’ ); $image->full_url = $full_src[0];

Gallery image caption inside link

You should get the attachment differently. Use wp_get_attachment_url for the file url https://codex.wordpress.org/Function_Reference/wp_get_attachment_url In your case it’s an image so I would suggest wp_get_attachment_image_src so you can define an image size. https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/ This way you can greate your own “template” to echo the image link. To get the image metadata you can simply use get_post( … Read more

Add image to gallery with slug

https://codex.wordpress.org/Gallery_Shortcode By default the gallery shortcode will only accept IDs or if left blank will default to current page. You need to create a plugin and register your own shortcode or download one that already exists. https://www.google.co.uk/search?q=gallery+load+by+url+wordpress&oq=gallery+load+by+url+wordpress&aqs=chrome..69i57.9981j0j4&sourceid=chrome&ie=UTF-8

Implementing Lightbox Photo Gallery in

I got the answer from someone else and got it working. To summarize, the problem was not having the right use of WP functions to call the custom post thumbnail image dynamically. Hence the BueggetteBox.js plugin (a lightbox plugin) functionality would work properly when you clicked on a custom post thumbnail from the gallery within … Read more

WordPress WebSite is jumps while scrolling bottom [closed]

You have some css that is conflicting and causing the issue when the top menu sticks absolute on scroll down and the header hides. In your media.css on line 340 you have: @media (min-width: 768px){ .main-navigation { clear: both; display: block; float: left; width: 100%; } } Changing that in live dev tools to: @media … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)