The tag has no wiki summary.

learn more… | top users | synonyms

10
votes
2answers
3k 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 ...
10
votes
2answers
908 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 ...
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): ...
8
votes
1answer
591 views

Any way to add custom options to Gallery Settings?

Now that Wordpress has updated to version 3.5, the media gallery has been overhauled and this custom options solution doesn't appear to work anymore. I'd like to add a couple of fields to the gallery, ...
7
votes
9answers
1k views

Creating a photo gallery in WordPress [closed]

At times I've tried a few different solutions for a WordPress-powered photo gallery. There are lots of options, including plugins and custom post types. Theme matters a lot, here. ma.tt has a pretty ...
7
votes
5answers
522 views

Use a separate custom table (not posts) to handle file upload data

The Problem: Website that has over 100 photos per post. Could possibly swell posts-table beyond 100K entries within a few years. The Dilemma: Would much rather stick to default WP UI for handling ...
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?
6
votes
1answer
1k views

Make a really simple gallery structure

The default gallery structure of WordPress is really tortuous: <div id="gallery-1" class="gallery..."> <dl class="gallery-item"> <dt class="gallery-icon"> ...
6
votes
4answers
4k views

How can I alter the [gallery] markup?

I would like to change the markup created by [gallery] from what is it as standard (dl) to a unordered-list with a difference. Below is the desired markup: <ul> <li><a ...
6
votes
1answer
502 views

Gallery Inside One Post

For image galleries, I need a code that uses next/previous links to bring you to the next/previous image in that post and keeps the images in the correct order you chose while inserting them into the ...
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 ...
5
votes
3answers
643 views

WP 3.5 and Galleries - how to count images?

I'm trying to figure out how to count and display the number of images in a gallery with WP 3.5. I was following an old post on Ottopress, querying the DB for attachments but it seems the galleries ...
5
votes
1answer
1k views

Add existing images from Media Library in to custom gallery

I have [gallery] inside the post, and I'm interested in a way to add already existing images from media library in to this gallery? once I trying add any image I have only one option - insert into ...
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 ...
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 ...
4
votes
1answer
338 views

Navigate with keyboard in Gallery shortcode

I am using Wordpress Gallery shortcode and I was wondering if there is a way to navigate using the arrow keys? Like if I view an single image and used the right arrow to navigate to the next image in ...
4
votes
1answer
429 views

What is the action hook for save media-form on gallery tab?

I want to save a meta data to post parent when the media-form on gallery tab is saved( The submission button is "Save All Changes"). Which action hook can I use?
4
votes
2answers
747 views

Cropped featured image replaces original image in gallery

Firstly, I have done my research as thoroughly as I possibly can. Searches have been made, but I have not found any advice or solution as to my exact issue. Ok, time to explain. Currently I am ...
4
votes
1answer
829 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.
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
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 ...
3
votes
2answers
325 views

Two embedded gallery in one post

I've a nice question for you. Is there an easy way, to embed two galleries in the same post? I refer to the wordpress embedded gallery. Using a plugin of-course. Is there outside a plugin other than ...
3
votes
3answers
7k views

Load entire NextGEN gallery from single thumbnail?

I'm using Alex Rabe's NextGEN Gallery in a lot of client sites as a centralized image repository, and am finding I often need to load an entire gallery into a lightbox (invoked via a single ...
3
votes
1answer
870 views

First three images in post excerpt

I have certain posts that are nothing but [gallery] with quite a few images in them. Is there a way to define an auto generated excerpt to only display the first three images for these posts on the ...
3
votes
2answers
338 views

PHP/Manual use of images? - 2 Questions

I've made a quick PHP script/page that uses the wp_insert_post() function to insert a post directly. And this works great. The post I am manually adding has an image in it, so I firstly ...
3
votes
1answer
424 views

get images from post and make a zip

here is what i have so far. function zip_gallery() { global $post; $images = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'numberposts' => -1, ...
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 ...
3
votes
1answer
1k views

Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)

I'd wish to use WP 3.x standard Media Librery rather than relying on 3rd party plugins like NextGen no matter how well they're written. I just don't like duplicating functionalities. Media Librery ...
3
votes
2answers
491 views

how to test for attached image

I am trying to find out whether or not a post has images. If it does, I then want to know if a featured image was specified for the thumbnail - if not, the get_thumb() function will assign an image ...
3
votes
1answer
1k views

How to make a page template to list all galleries?

I'm trying to code a theme where I'll have a universal gallery page. Basically like: http://www.engadget.com/galleries/ However I'm at a loss for what I'd use to call all the galleries. I need the ...
3
votes
1answer
284 views

how do i create a downloadable gallery with image descriptions?

I am creating an educational site for medical students using wordpress and would like to have an image gallery that displays a short description of each image and has a selection box beside it (as ...
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?
3
votes
1answer
597 views

How can I remove or change a border/outline on a picture when it is in a gallery page?

You can see on this page: http://www.middlegray.net/ceremonies/ the photos have a white box that is automatically applied to the pic. I want to take it off or make it a different color. Where would I ...
3
votes
1answer
432 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 ...
3
votes
1answer
89 views

Modifying the media-template.php file, the right way?

The [gallery] shortcode accepts the columns='0' as an attribute so that it doesn't insert any breaks in the HTML between gallery items, however this option is not available in Gallery Settings ...
3
votes
1answer
628 views

Bulk edit wordpress images alt and title attributes

I uploaded around 600 pictures in different galleries in wordpress without setting the titles and alt attributes. I need to edit them, I was wondering a way to edit them by album, let's say the title ...
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 ...
2
votes
3answers
883 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
2answers
902 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
859 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
3answers
371 views

get attributes/part of the gallery shortcode

I'm trying to grab all image id's that are associated with the [gallery] shortcode that are listed as exclude. For example: if my post has [gallery exclude="1,2,3"] I'd like to get a variable that ...
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
1answer
932 views

Display all albums in nggallery on a page

I'm using the popular NextGen Gallery / nggallery plugin to handle photo albums and galleries on my site. I can arrange photos into a album and display it using a shortcode no problem, where I'm ...
2
votes
3answers
602 views

Remove [gallery] shortcode altogether

I used remove_shortcode('gallery'); ...the gallery is gone, but the shortcode is visible in the text. How do I remove sitewide? I've searched for sql queries, but no solution fixes my specific ...
2
votes
3answers
493 views

How can I show these pictures in two columns in my page?

This page is long and cumbersome. I am trying to find a plugin/hack that would put the images on this page in two columns to make it a bit easier to digest. Removing the <p> tags doesn't seem to ...
2
votes
3answers
609 views

What is a good way to implement photo galleries on Wordpress?

I want to publish about 1GB of photos on my Wordpress-powered website. I want viewers to load the photos quickly, but also tobe able to download high-resolution versions. Here is what I have tried. ...
2
votes
2answers
163 views

Storing image gallery plugin data

I'm making image gallery plugin and I'm not sure what is the best way to store data in WordPress. Plugin can contain multiple gallery instances with some options and each gallery contains images with ...
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 ...
2
votes
2answers
265 views

Display latest 10 galleries

I want to create a custom page that will display let's say 20 latest galleries / page - but only the first image from the gallery, not all of them. something like this: ...
2
votes
2answers
474 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 ...