Multiple gallery thumnbnails on one page
Multiple gallery thumnbnails on one page
Multiple gallery thumnbnails on one page
WordPress gallery image link gives 404 when not logged in
Changing ‘post_parent’ => $post->ID to ‘post_parent’ => null will fetch all images.
1) enque thickbox on front end add_action(‘init’, ‘myplugin_thickbox’); function myplugin_thickbox() { if (! is_admin()) { wp_enqueue_script(‘thickbox’, null, array(‘jquery’)); wp_enqueue_style(‘thickbox.css’, “https://wordpress.stackexchange.com/”.WPINC.’/js/thickbox/thickbox.css’, null, ‘1.0’); } } 2) Add thickbox to all your images that are displayed by the_content(); function fb_add_thickbox($content){ $content = preg_replace(‘/<a(.*?)href=”https://wordpress.stackexchange.com/questions/106603/(.*?).(jpg”jpeg|png|gif|bmp|ico)”(.*?)><img/U’, ‘<a$1href=”$2.$3″ $4 class=”thickbox”><img’, $content); return $content; } add_filter(‘the_content’, ‘fb_add_thickbox’, 2); sources: http://wordpress.org/support/topic/how-to-implement-thickbox-to-all-images-which-contain-a-refered-link http://www.ultimatewebtips.com/how-to-use-wordpress-native-thickbox-support-in-front-end/
If you want to override the default gallery CSS, first, unhook the core-defined CSS: add_filter( ‘use_default_gallery_style’, ‘__return_false’ ); Then, you can add your own CSS, however you wish – using your Theme style.css, or via separate CSS file that you enqueue, etc.
Take a look at gallery shortcode documentation (Codex) id specify the post ID. The gallery will display images which are attached to that post. The default behavior, if no ID is specified, is to display images attached to the current post. For example, to display images attached to post 123: So yes, you should put … Read more
install an image gallery plugin like this one http://wordpress.org/plugins/image-gallery-reloaded/ and have a gallery set in each of your posts, then edit your theme’s category template and have a look at the loop, if it uses the_excerpt() then you have to alter it to the_content(). This way, you will have a gallery list in the category … Read more
Thickbox not displaying just the image, instead showing full page in lightbox
A gallery is at heart just the set of attached posts, so… $post_id = 1; // set to your desired parent post $attachments = new WP_Query( array( ‘post_parent’ => $post_id, // post to which the gallery is attached ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, // ‘order’ => $order, // ‘orderby’ => $orderby … Read more
Gallery requires a featured image but does not show it in posts/pages