0
votes
0answers
38 views

Remove Captions from Custom Gallery function.php

I like to prevent captions from being outputted in my custom gallery function. I could easily just hide it using CSS but it doesn't feel right. The caption is being sent from media.php this line. ...
0
votes
0answers
16 views

Change Wordpress Gallery Markup in functions.php

I'm looking to change the markup of the Wordpress Gallery, so that it outputs a new set of code. Ideally, this is what I want (a Bootstrap-based markup). <div class="col-md-3 col-sm-4"> ...
0
votes
1answer
53 views

How to add 'data-caption' inside an anchor tag

bellow is custom gallery code. function custom_gallery_shortcode( $attr = array(), $content = '' ) { $attr['itemtag'] = "li"; $attr['icontag'] = ""; ...
0
votes
1answer
360 views

Add gallery id to rel attribe of wp_get_attachment_link

Now i have this snippet in my functions.php /** * Add rel to links. */ function add_rel_to_gallery($link) { return str_replace('<a href=', '<a data-fancybox="true" rel="group" href=', ...
0
votes
2answers
35 views

Detecting if parent page has gallery

My function to detect is a gallery is on a page has broken and Im not sure why. So in my theme template's attachment page Im calling this function: global $post; $parent_id = $post->post_parent; ...
0
votes
1answer
209 views

Help with WP gallery function, wrap gallery in div

I have a function in my functions.php file I need to change slightly and am having trouble doing it correctly. This function changes the gallery markup for Wordpress, making it more html5 friendly. It ...
1
vote
1answer
72 views

Display gallery on bottom after content

How to execute the gallery shortcode after any other content no matter where the shortcode is in the post HTML? Thanks.
1
vote
0answers
84 views

Way to add captions to gallery images by code

I am creating posts by using wp_insert_post function. It works fine as I provide values in array required. Sometimes it is required to create a post having gallery. Without any problem, it also works ...
0
votes
1answer
25 views

Functions Error: Impacting Galleries

The function below controls an option inside an options panel. What it does is choose the number of posts being displayed in a particular archive (to_count archives, to_count_home, to_count search ...
1
vote
1answer
158 views

watermarking gallery items

How can I add an image watermark to only those images which are to be published in gallery using a function in functions.php? Images can be in .jpg, .png, .gif format. I also found this snippet ...
1
vote
2answers
313 views

Custom gallery in wp3.5

I used a tutorial I found for a slick little custom gallery in 3.4, but upon upgrade to 3.5 it no longer works. I'm trying to learn php still and can't seem to get this working again, as I either get ...
1
vote
1answer
259 views

Adding option to Gallery shortcode

just starting out in WP dev, and I'm looking for any guidance I can get. What I'd like to do is use a hook or filter to add my own option to the core WP gallery shortcode. I would want it to work just ...
0
votes
2answers
95 views

Check if a different page has any attached images

I am trying to make a notification function for a user's account dashboard that displays if they have not added any images to their profile's gallery. I found this page, which is a function that ...
0
votes
2answers
258 views

Wordpress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?

I wonder if Wordpress is the best CMS or solution for what I wannt to do? I need to find some way to upload images to a post that I can loop as background images. Just like I can upload multiple ...
0
votes
1answer
283 views

Gallery Shortcode Function Help

Okay, so I found this code online that allows you to add the option of how many thumbnails you want to show in the gallery shortcode. The code below is what they say to add to the functions.php file ...
9
votes
4answers
16k 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): ...
0
votes
1answer
421 views

Auto create Nextgen Gallery on post creation

I was wondering if there is a way to create a nextgen gallery with a function, so that I can hook that into my front end post creation setup. The gallery could be completely empty or be created with ...
1
vote
2answers
660 views

Display gallery on top before content

Is it possible to execute the gallery shortcode before any other content no matter where the shortcode is in the post HTML?
1
vote
1answer
2k views

Default Gallery Edit/Template Editable?

I quite like the default WordPress Gallery, but i dont like how it plonks the images as thumbnails, with a link to the larger image. Is there anyway to make it display the images not in a thumbnail ...