wordpress-bootstrap icon indicating copy to clipboard operation
wordpress-bootstrap copied to clipboard

Update the gallery shortcode

Open McGun opened this issue 10 years ago • 5 comments

Now the images does not have to be attached to the specific post/page as the shortcodes goes in.

Someone may have to look a bit closer to the code. I'm not a php-guru, but it took me a few hours to work this out. Anyway, I hope this contributes to the project.

McGun avatar Jul 10 '13 23:07 McGun

Yes, there are a few issues with the gallery atm.

@McGun, switching to your branch through out a few errors:

Notice: Undefined variable: array in /Users/noah/Repos/wordpress-bootstrap/wp-content/themes/wordpress-bootstrap/library/shortcodes.php on line 15

Notice: Undefined variable: post in /Users/noah/Repos/wordpress-bootstrap/wp-content/themes/wordpress-bootstrap/library/shortcodes.php on line 18

Notice: Trying to get property of non-object in /Users/noah/Repos/wordpress-bootstrap/wp-content/themes/wordpress-bootstrap/library/shortcodes.php on line 18

Notice: Undefined index: in /Users/noah/Repos/wordpress-bootstrap/wp-content/themes/wordpress-bootstrap/library/shortcodes.php on line 28

Notice: Trying to get property of non-object in /Users/noah/Repos/wordpress-bootstrap/wp-content/themes/wordpress-bootstrap/library/shortcodes.php on line 31

Notice: Trying to get property of non-object in /Users/noah/Repos/wordpress-bootstrap/wp-content/themes/wordpress-bootstrap/library/shortcodes.php on line 32
Missing Attachment

The original code shows the gallery. Hopefully a couple of fixes will make it work.

noahbass avatar Jul 10 '13 23:07 noahbass

The solution is here https://github.com/320press/wordpress-bootstrap/issues/97

jsmeltzer avatar Jul 10 '13 23:07 jsmeltzer

Great that there already is a solution! =)

McGun avatar Jul 11 '13 08:07 McGun

This code fix is broken. The new line #15 is:

$ids = explode(",",$array['ids']);

it should be:

$ids = explode(",",$attr['ids']);

rondavis007 avatar Sep 27 '13 23:09 rondavis007

Guys, I found a little bug in new line #32:

$output .= wp_get_attachment_link( $attachment->ID , 'thubnail', true );

should be

$output .= wp_get_attachment_link( $attachment->ID , 'thumbnail', true );

19th avatar Nov 04 '13 09:11 19th