diff --git a/image.php b/image.php index 5e14919b6..97dbf205a 100644 --- a/image.php +++ b/image.php @@ -48,15 +48,19 @@ if ( $attachment->ID == $post->ID ) break; } + $k++; + // If there is more than 1 attachment in a gallery if ( count( $attachments ) > 1 ) { - if ( isset( $attachments[ $k ] ) ) + largo_gallery_enqueue(); + if ( isset( $attachments[ $k ] ) ) { // get the URL of the next image attachment $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); - else + } else { // or get the URL of the first image attachment $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); + } } else { // or, if there's only 1 image, get the URL of the image $next_attachment_url = wp_get_attachment_url(); diff --git a/inc/enqueue.php b/inc/enqueue.php index 4e44a00ac..08439f811 100644 --- a/inc/enqueue.php +++ b/inc/enqueue.php @@ -86,18 +86,17 @@ function largo_enqueue_js() { */ function largo_gallery_enqueue() { $slick_css = get_template_directory_uri() . '/lib/navis-slideshows/vendor/slick/slick.css'; - wp_enqueue_style( 'navis-slick', $slick_css, array(), '1.0' ); + wp_enqueue_style( 'navis-slick', $slick_css, array(), '1.0', true ); $slides_src = get_template_directory_uri() . '/lib/navis-slideshows/vendor/slick/slick.min.js'; wp_enqueue_script( 'jquery-slick', $slides_src, array( 'jquery' ), '3.0', true ); $slides_css = get_template_directory_uri() . '/lib/navis-slideshows/css/slides.css'; - wp_enqueue_style( 'navis-slides', $slides_css, array(), '1.0' ); + wp_enqueue_style( 'navis-slides', $slides_css, array(), '1.0', true ); $show_src = get_template_directory_uri() . '/lib/navis-slideshows/js/navis-slideshows.js'; wp_enqueue_script( 'navis-slideshows', $show_src, array( 'jquery-slick' ), '0.11', true ); } - add_action( 'wp_enqueue_scripts', 'largo_gallery_enqueue' ); } if ( ! function_exists( 'largo_enqueue_child_theme_css' ) ) { diff --git a/inc/widgets/largo-author-bio.php b/inc/widgets/largo-author-bio.php index 013bfc328..65f7e0236 100644 --- a/inc/widgets/largo-author-bio.php +++ b/inc/widgets/largo-author-bio.php @@ -53,6 +53,7 @@ function widget( $args, $instance ) { } else { $bio = ''; } + if ( ! is_author() && empty( $bio ) ) { unset( $authors[$key] ); } else { diff --git a/lib/navis-slideshows/navis-slideshows.php b/lib/navis-slideshows/navis-slideshows.php index 4a7d088cb..3751b48c7 100644 --- a/lib/navis-slideshows/navis-slideshows.php +++ b/lib/navis-slideshows/navis-slideshows.php @@ -38,16 +38,18 @@ function __construct() { if ( ! is_admin() ) return; - add_action('save_post', array( &$this, 'tag_post_as_slideshow' ), 10, 2); - remove_shortcode('gallery'); - add_shortcode('gallery', array(&$this, 'handle_slideshow'), 10, 2); + add_action( 'save_post', array( &$this, 'tag_post_as_slideshow' ), 10, 2); + remove_shortcode( 'gallery' ); + add_shortcode( 'gallery', array( &$this, 'handle_slideshow' ), 10, 2); } /** * * @uses global $post WP Post object + * @uses largo_gallery_enqueue(); */ function handle_slideshow( $output, $attr ) { + largo_gallery_enqueue(); /** * Grab attachments */