Support

Account

Home Forums Add-ons Gallery Field Colorbox not working with Gallery add-on

Solved

Colorbox not working with Gallery add-on

  • There is no sign of the colorbox. Colorbox attribute is added correctly, there is no Javascript error thrown. Clicking on the image goes to the attachment page. I can see no way of changing this to file (if that’s actually at the root of this problem)

    any ideas?

    WP 3.9.1 with all up to date plugins and a very simple theme

  • To work with Colorbox, this

    <?php 
     
    $image_ids = get_field('gallery', false, false);
     
    $shortcode = '
     
     
    [gallery ids="' . implode(',', $image_ids) . '"]
    ';
     
    echo do_shortcode( $shortcode );
     
    ?>

    needs to be

    <?php 
     
    $image_ids = get_field('gallery', false, false);
     
    $shortcode = '
     
     
    [gallery ids="' . implode(',', $image_ids) . '", link="file"]
    ';
     
    echo do_shortcode( $shortcode );
     
    ?>
    
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Colorbox not working with Gallery add-on’ is closed to new replies.