The tag has no wiki summary.

learn more… | top users | synonyms

17
votes
2answers
4k 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 ...
8
votes
2answers
26k 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?
11
votes
4answers
20k 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
3k 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 ...
-2
votes
2answers
3k 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?
7
votes
3answers
4k 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 ...
4
votes
1answer
3k 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
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 ...
1
vote
2answers
2k 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 ...
2
votes
3answers
127 views

Responsive Images

Is there a native function to display the correct responsive image size for post thumbnails or gallery images depending on the screen resolution? Normally I'm using: 1.Custom image sizes: function ...
0
votes
1answer
584 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
3k 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
398 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?
3
votes
3answers
8k 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 ...
6
votes
3answers
4k 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
3k 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 ...
2
votes
2answers
2k 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 ...
1
vote
1answer
2k 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 ...
4
votes
3answers
11k views

How to show description under an inserted image?

I'm using wordpress' native media manager. I have a problem. I can show the title under the image. But I want also to show the description. Is it possible to do?
3
votes
1answer
3k views

Can I load posts via Ajax?

I would like to make a portfolio page where each entry (a post) would be fetched using Ajax. This way I would have an image gallery, but in which I not only would have images but also the ...
1
vote
1answer
203 views

Making WordPress Gallery (.gallery-item) Responsive?

Shortcode for Gallery: [gallery link="file" columns="5" size="medium"] I’m using a 5 column gallery on an inner page of a website, obviously when the site responds down to mobile and even tablet ...
0
votes
2answers
4k 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" ...
3
votes
2answers
5k 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( ...
2
votes
3answers
1k 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
978 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
2k 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
297 views

Getting the image title/alt attribute from the gallery shortcode

I am trying to learn how to code php so that I can customize the image gallery within WordPress (among other customizations). The code I have works great for a stylized gallery page, but having a ...
0
votes
2answers
2k views

ID of images from gallery

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.
0
votes
1answer
1k 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 ...
0
votes
1answer
2k views

How to Add a Custom Colum on Thickbox Media Gallery Tab?

On searching for a solution, I found the following codes to add col on media page: add_filter ( "manage_upload_columns", 'upload_columns' ); add_action ( "manage_media_custom_column", ...
10
votes
2answers
2k 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 ...
2
votes
4answers
10k 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
0answers
71 views

Custom wordpress gallery option

I would like to add custom option to default wordpress gallery tab. I need something simple just a drop down to add offered style, this would add predefined class to gallery on client side and on ...
2
votes
1answer
456 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. ...
1
vote
2answers
1k 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 ...
1
vote
3answers
495 views

Post photo galleries [closed]

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 ...
3
votes
2answers
1k 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 ...
3
votes
2answers
3k 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 ...
2
votes
4answers
2k views

Wordpress 3.5 Gallery Menu Order not set?

With the new Gallery editor in Wordpress I am able to set up my galleries and to drag the Thumbnails to re-arrange the image order. On the backend that seems to work fine. But I ran into an issue when ...
2
votes
2answers
751 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
1answer
10k 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 ...
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
2k 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 ...
0
votes
3answers
426 views

Looking for a photo gallery plugin [closed]

I'm hoping someone can help me with this. I have looked all over and can't seem to find what I need. I am looking for a WP plugin that will allow my site users to easily create their own photo ...
3
votes
1answer
215 views

Excludes posts that don't have attachments in the_content()

I'm trying to write a loop that excludes posts that don't have attachments in their content areas. I've got 200 posts in a custom post type called "students". I need to do a query of all students ...
3
votes
4answers
2k views

Overide Gallery Default Link to Settings

Is there way to control the gallery default “Link to” setting? Using the image_default_link_type filter within a functions.php file works on inserting single images into posts but it doesn't seem to ...
3
votes
1answer
445 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
1answer
559 views

Set default link type to “file” for image galleries

Whenever you add a image gallery to a post, the images automatically link to the image attachment pages. This is not ideal, because I want to use Fancybox so the user can cycle through the images. I ...