Tag Info

New answers tagged

0

As I've explained elsewhere, you can modify the image sizes of the get_post_gallery() or get_post_gallery_images() with a simple filter: // Add a filter for full gallery size: add_filter( 'shortcode_atts_gallery','wpse_full_size_gallery' ); $gallery = get_post_gallery( get_the_ID(), false ); // Remove the filter: remove_filter( ...


0

wp_get_attachment_image_src returns an array with 3 elements; the image URL, the width, and the height. You need to echo the first index of the result. In fact, you can make your code a little leaner by using a foreach loop: foreach ( $images as $i => $image ) { $src = wp_get_attachment_image_src( $image->ID, 'full' ); echo '<img ...


0

I found a solution, but it seems rather cumbersome. I would think a cleaner solution would be possible using WP’s native thumbnail functions, but I can’t figure it out. When I use the “tribe_event_featured_image” function, it replaces the images well wherever that function is loaded in the templates. However, I also use for example the Genesis Framework and ...


0

I took a quick look at the Modern Tribe's source code, particularly the single-event.php view template. MT is using an internal function, tribe_event_featured_image(), which includes a filter: tribe_event_featured_image. You could use this filter to see if MT has already found an image, and, if not, look up your own and return its value. add_filter( ...


0

I know this is old but I was looking for an answer to this problem so that I could save a thumbnail rather than use the full size image for a log and couldn't. I have figured it out for my needs by doing the following: When choosing an image I hook into the customize_sanitize_{$this->id} filter. This gives me the image url in a filter to do what I want ...



Top 50 recent answers are included