Tag Info

New answers tagged

-3

use Nextgen Gallery plugin to enable image management at its best. You can create album, galleries, set watermarks and more. With this you can create image galleries with the template option given within.


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

depend on your code if you use it as gallery shortcode i think this will work : <div class="gallery-content"> <?php if( has_shortcode( $post->post_content, 'gallery' ) ) : if ($ids != '') { $images = explode(',', $ids); } else { $images = get_children(array('post_parent' => get_the_ID(),'post_type' => ...


0

Here's a version of the linked solution that overrides galleryAddToolbar to have an extra button (insertTop) to do what you want (in your "functions.php"): add_filter( 'media_view_strings', function ( $strings, $post ) { $strings['addToGallery'] = __( 'Add to end of gallery' ); $strings['addToGalleryTop'] = __( 'Add to start of gallery' ); ...


0

How about simply using the get_post_gallery() function. This is exactly the way, most themes are checking if a post has a gallery to print the correct body CSS classes: if ( get_post_gallery() ) { // run your code in here } P.S. I really don't like solutions that search the whole content for anything, even if string functions are typically quite fast ...


0

Embedded two galleries in the order according to my need. Then used the get_post_galleries to get the galleries in an array.


0

The established technique of passing data to JavaScript in WordPress is wp_localize_script(). Despite the name it's widely used for arbitrary data, outside of localization purposes. So it is certainly possible to retrieve the necessary data and pass it to the script in this way.


0

get_post_gallery_images only returns a singular array of image URLs, so $image->post_title etc won't work, hence your error message. The approach generally is off - you've followed the codex for get_post_gallery_images but that snippet is aimed at re-using the image urls within the post, but outside the gallery output. get_attached_media is more suited ...


1

You can use "rilwis/meta-box " for this . For dynamic slider use this snippet, <?php $images = rwmb_meta( 'gallery', 'type=image' ); foreach ( $images as $image ) { echo "<a href='{$image['']}' title='{$image['title']}' rel='thickbox'><img src='{$image['full_url']}' alt='{$image['alt']}' /></a>"; } ...



Top 50 recent answers are included