The tag has no wiki summary.

learn more… | top users | synonyms

10
votes
2answers
2k views

Turn a URL into an Attachment / Post ID

Is there any way I can take a URL of an image and find the attachment or post id of that image in the database? Here is the situation: I'm in a loop going over all the 'img' tags that are surrounded ...
9
votes
3answers
13k views

How to manually fix the WordPress gallery code using PHP in functions.php?

It's been talked many times that Wordpress outputs some really bad code for the built-in gallery function. This is the core code responsible for the gallery output (in /wp-includes/media.php): ...
3
votes
3answers
2k views

Adding jquery and thickbox to WordPress theme

I would like to add thickbox for the template which I develop to WordPress. At this time I'm trying with a clean template that have only header.php, footer.php,index.php, and functions.php. I've ...
6
votes
2answers
18k views

How to customise the output of the WP image gallery shortcode from a plugin?

We're building a plugin that displays posts, and we also want to display the image gallery when it is used in a post. However, we need to limit the number of photos displayed? Is that possible?
-2
votes
2answers
2k views

How can I make all gallery images to open in a new window?

How can I make all gallery images to open the high resolution image in a new window?
2
votes
1answer
2k views

Retrieving a custom link on an attachment

I wanted to link images in a gallery to a custom URL. I know I could add an extra field and do it this way I found this ticket on Trac, though, that modifies the "Link URL" field to accept custom ...
0
votes
1answer
482 views

Any good lightbox-like option that works in WP 3.2.1?

I'm having problems finding a "plugin" that will help me display some of my images in a nice way such as prettyPhoto, Lightbox etc. As I'm already using the jQuery library, I'd prefer a plugin that ...
4
votes
2answers
2k views

add_filter and changing output captions of image gallery

I'd like to change only one output of native WP Gallery (in media.php) On Smashing Magazine (link) author advises to change whole gallery_shortcode function. But I wondered if is possible to change ...
3
votes
1answer
291 views

How do i link gallery thumbnails to different url's using the wp native gallery?

Is it possible to link each gallery thumbnail if i use the built in WordPress native gallery?
4
votes
1answer
1k views

How to call WP3.5 Media Library manager?

In the past Media Library window could be called like this: tb_show("Upload image", "media-upload.php?type=image&TB_iframe=1&width=640&height=520"); This still works in WP3.5. But I'm ...
5
votes
2answers
3k views

Check if post/page has gallery?

I'd like to run some code only if a gallery (inserted with the [gallery] shortcode) has been inserted into a post/page. I did the following: gallery_shortcode($post->ID) ? $gallery = 1 : $gallery ...
4
votes
1answer
822 views

How to paginate wordpress [gallery] shortcode?

I am using wordpress gallery shortcode [gallery] I was wondering if there is anyway to paginate them without using a plugin.
2
votes
3answers
7k views

Using nextGen Gallery.. how can I call a list of all Gallery Names?

I'm trying to make a nav to access all the different galleries on a single page. Instead of hard-coding all their names out. I was curious if it was possible to make this dynamic and just call all ...
1
vote
1answer
1k views

Gel all image from certain post type

I've found similar questions here, however I can't modify the answers to get images only from a certain post type - as the post type in those examples are "attachment" and not the name of a custom ...
0
votes
2answers
2k views

How do I get gallery thumbnail URL and change the default thumbnail size?

when I create a gallery I get this code generated yet I can;t find out how <img width="150" height="150" src="http://localhost/wp2/wp-content/uploads/2012/06/28_0120-150x150.jpg" ...
2
votes
3answers
881 views

WordPress gallery 'post_gallery' filter doesn't work with feeds?

We can use the post_gallery filter to modify/replace the default WordPress gallery template (AKA output code) to suit our needs. But this doesn't seem to affect the markup in RSS feeds. No matter ...
2
votes
5answers
2k views

Insert into Post button is missing for certain images

I thought I was crazy, but on some of the images in my media gallery, there is no "insert into post" button. see the picture: this is only for some images though, and the button is there, like ...
1
vote
2answers
616 views

Wordpress Gallery shortcode: Display one category ID only

Good Day. I am using a Gallery shortcode in my wordpress site to display images. Problem is that I wasnt the gallery to show only images from a certain category, for example category id 35. How do I ...
1
vote
2answers
1k views

Remove width and height attributes from [gallery] output

WordPress automatically adds the width and height attributes to [gallery] shortcode images. How to delete these attributes? Something like this but for [gallery] output.
1
vote
2answers
3k views

How do I filter title and alt attributes in the gallery shortcode?

I am displaying a post gallery inside a custom post type, using the following in my single-custom.php template: <?php echo do_shortcode('[gallery id="'.$post->ID.'" link="file" columns="5" ...
0
votes
1answer
362 views

ID of images from wordpress galelry

Does anyone know how to get ID's of images from wordpress gallery in post? I have search entire internet and there is nothing to this subject. Thx for your time :)
0
votes
1answer
728 views

conditional shortcode not working

I'm using a plugin, NextGEN gallery, to display photos. Each gallery from this plugin corresponds to a different sub-page, so I'm using conditional shortcodes to assign the right gallery to it's ...
10
votes
2answers
904 views

ZIP up all images displayed in a [gallery] and offer as download link

I would like to offer my visitors the option to download the entire photo gallery (displayed on dedicated [gallery] pages) as a ZIP file displayed at the bottom of each gallery page. - The full-sized ...
1
vote
4answers
5k views

How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?

I am trying to retrieve all the images from the Gallery of a page in the order they are set in the backend. So far I have: $my_wp_query = new WP_Query(); $all_wp_pages = $my_wp_query->query( ...
2
votes
1answer
423 views

The WordPress Gallery, Grabbing The Link and Images?

I have created a template for gallery named image.php which allows me to create a news website style image gallery that can be embedded in posts. But I need two more things to make this complete. ...
2
votes
2answers
359 views

Post photo galleries

Anyone know how to make a gallery post where you make one image the cover of the photo gallery and whenever it is clicked it links to the gallery? The use this method on thechive.com. I'm really not ...
2
votes
2answers
893 views

Automatically add this attribute to the gallery shortcode

When inserting a gallery it adds the following shortcode: [gallery columns="6" ids="18,150,146,23,147,17,21,20,22"] I would like it to automatically add link="file" as the last attribute, whenever ...
2
votes
2answers
471 views

Disable gallery in 3.5 media iframe

I'm creating a setting to set a logo. It works but there is a problem. I only need one image to be set so the gallery item should be disabled / hidden. Of course this should only effect this page, of ...
1
vote
2answers
310 views

Split Content and Gallery

Is there a way to split up the post content and the gallery short code. I want to display the gallery outside my normal content no matter how or where it is placed. I can use this to get the shortcode ...
1
vote
2answers
921 views

Add size in Gallery Settings in Media Library

I would like to add the size in the Gallery Settings in the Add Media. I know to add the in the front-end by editing the media.php. However, when I added the the lines in gallery.dev.js, they don't ...
0
votes
2answers
1k views

Add option to “Gallery Settings” section

I want to add a option to the "Gallery settings" (when you insert a gallery into a post). I once found some code on how to do this, but unfortunately I can't find it anymore. I can't even remenber if ...
0
votes
2answers
1k views

Proper Way to Remove Thumbnail Links In Gallery

I use the post_gallery filter in functions.php to replace the core gallery code, with the gallery code I've modified to suit my needs, like this: function aahan_post_gallery($output, $attr) { ...
0
votes
3answers
1k views

Ajax, filters and shortcodes

could you figure out why I'm unable to get shortcode filters applied in ajax inclusion of posts? Let me explain better: I've managed to include a post from within another post, through ...
3
votes
2answers
2k views

How do you modify the HTML output of a Gallery item (using the gallery shortcode)?

Im a bit lost on this simple problem so i thought id come and ask the pros. Ive just been told by my client that on their sites gallery, the name and description are on the same line. so for example ...
3
votes
1answer
430 views

Build path for a custom portfolio plugin

I'm finishing up a personal site that I've spent many weekends on. I've left one of the (potentially) most complicated parts to the end of production. I'm looking for some advice on how to proceed ...
2
votes
2answers
664 views

remove featured image from gallery woocommerce

I am using wooCommerce. When i set the featured image for a woocommerce product, it shows up as the first/main image in the gallery on the product details page. I need to remove the featured image ...
2
votes
2answers
857 views

Wp3.5 Media Gallery Edit modal: change captions to title

How can i change those editing inputs to title from caption? Some sources i found about new upload system: Using the WordPress 3.5 Media Uploader within plugins How to Add the WordPress 3.5 Media ...
2
votes
1answer
3k views

Gallery set to “Media file”, showing as attachment page

I am using WP 3.5.1 and lightbox plus 2.5.5 I have my lightbox set to "Use for WP Gallery" Lightbox is working successfully on one of my posts with a single image, but on another post I have 3 ...
2
votes
1answer
249 views

How do I change the gallery that is inserted in the post?

When I insert a gallery to a blog post using the [gallery] shortcode or simply the insert media button I get a default structured gallery in my blog through the_content(); However the gallery comes ...
2
votes
2answers
168 views

Looking to display non-image files in Gallery with logo specific to file type

When I first began looking into this, File Gallery got me much closer to solving the problem. The only issue is that the plugin only displays the generic non-image icon when I upload a file. Does ...
2
votes
5answers
3k views

Media gallery - inserting full size images without link

I want to use built-in WP media gallery. I'm trying to simply add images in one - horizontal line. I want images with original size and without any link. I'm trying to add/edit some code into ...
1
vote
1answer
138 views

Extracting gallery images in Wordpress 3.5 on index.php

I'm trying to add a slider on my front blog page for every gallery post, but I have some trouble extracting the images from the post gallery, using the following code: $post_content = ...
1
vote
0answers
64 views

NextGEN Gallery- using shortcode for different galleries on different pages [duplicate]

Possible Duplicate: conditional shortcode not working I have a salon website with a gallery page wherein the user must first select a stylist prior to viewing their individual gallery. I ...
1
vote
2answers
6k views

Displaying a featured image (only img url) as the img src?

I have the following code: if (themedy_get_option('product_gallery')) { add_action('genesis_post_content', 'themedy_product_images', 1); } function themedy_product_images() { ?> <?php ...
1
vote
1answer
3k views

How to filter 'post_gallery' after all other filters/plugins etc

I'm trying to re-format the gallery output a bit, change default columns and link setting, as well as exclude the featured image from the gallery images. I can use *add_filter('post_gallery' ...)* in ...
1
vote
2answers
712 views

Can I attach an image to a different post?

Image galleries display those images that were uploaded to that post, by default. If I wanted to move an image to a different post, so it appeared there instead, would I have to delete and re-upload? ...
0
votes
2answers
69 views

Changing Gallery images size?

I'm grabbing URLs of my Gallery images: $gallery = get_post_gallery_images( $post ); foreach($gallery as $thumbnail) { echo $thumbnail_slideshow; } The problem is all I'm getting are ...
0
votes
0answers
89 views

How to Display Custom Post Type's Gallery (images ) in Through WP_Query

I am trying to load an Image Slider images from a Custom Post Type image Gallery Feature. For example let say I have an Custom Post Type called banner which I can load images to it's Gallery and I ...
0
votes
2answers
1k views

get_post_gallery_images returns thumbs . I want full size

I have the following code on my site. <?php // image gallery content if( has_shortcode( $post->post_content, 'gallery' ) ) { $gallery = get_post_gallery_images( ...
0
votes
1answer
75 views

Get a Page's attachments in Gallery order

Having created a page and a gallery within that page, I would like to retrieve all the images in that gallery in the order they are set when the gallery is created, i.e. the order which I drag them in ...