wordpress-bootstrap
wordpress-bootstrap copied to clipboard
Update the gallery shortcode
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.
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.
The solution is here https://github.com/320press/wordpress-bootstrap/issues/97
Great that there already is a solution! =)
This code fix is broken. The new line #15 is:
$ids = explode(",",$array['ids']);
it should be:
$ids = explode(",",$attr['ids']);
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 );