WordPress.org

Ready to get started?Download WordPress

Forums

The Bootstrap
Gallery widget and carousel not working (3 posts)

  1. athenagold
    Member
    Posted 1 year ago #

    Hi there, Sorry I posted this in the wrong place originally....

    I'm just getting started with this theme and I love it! Just one issue I've run into: the gallery widget and auto-carousel do not seem to work.

    I've created a post, added a gallery with the Add Media button, assigned it the post type 'gallery' and published the post. Then, I added the widget and selected the post, but nothing appears in the sidebar. Other widgets in the same sidebar show up, but the gallery widget does not - in the source, there is nothing at all where the widget should be. Furthermore, the post itself does not show the slick slider, but the standard gallery layout.

    Is there something I'm missing?

    Thank you for your help and for a great theme!
    Raeanne

  2. jmjf
    Member
    Posted 1 year ago #

    I decided to test this.

    I created a new post and made it a Gallery format. I clicked Add Media and added four images. I add metadata to three of them (caption, description, alt text) and one of them no metadata beyond the default title attribute. I clicked "Insert into Post" on the Add Media dialog. The four images showed up inline in the post space on the post editor with captions showing where I'd said captions or nothing on the image without a caption. I published the post. Viewed on my test site, the gallery post shows in the blog list with a slider that includes the four images with title and caption (from image metadata) in the overlay.

    When I select the post (displaying single, not the post list), the images show up inline in the post with captions, no slider.

    I added The Bootstrap Gallery Widget to the sidebar and told it to use Gallery Test (the name of the post above) and saved it. I refreshed the page and the gallery widget appeared with four pictures in a slider showing captions (just like in the post list).

    If you can't duplicate that behavior, then something is wrong. I recommend you pull a fresh version of the-bootstrap and replace your existing copy to be safe.

    (FWIW, I'm using the-bootstrap 2.1.0 pulled from github with Bootstrap 2.3.1 and some other customizations, but I haven't done anything with images or the gallery before now. The only thing I've done that might be affecting the above is added the clearfix class to widgets by default. This causes the gallery widget to change vertical size based on the image in the slider. Otherwise, I can't think of anything I've changed that might affect this.)

    Meanwhile, the following may be useful.

    You say there's nothing in source for the gallery widget. The gallery widget is coming from inc/the-bootstrap-gallery-widget.php. If that's blank, something is wrong with your copy of the-bootstrap. The file is not blank as far back as 1.7.1 on github, so it should be there whether you got 2.0.1 from wordpress.org or pulled code from github.

    On page source for the web page you should see something like this. (I recommend Firefox and Firebug or Chrome and Firebug so you can jump straight to the right place in the HTML and see it nicely formatted.)

    <div id="sidebar-gallery-slider" class="carousel slide">
    <div class="carousel-inner">
    <figure class="item"> (img, caption, etc.)
    <figure class="item"> (img, caption, etc.)
    <figure class="item active"> (img, caption, etc.)
    <figure class="item"> (img, caption, etc.)
    </div>
    <a class="carousel-control left" data-slide="prev" href="#sidebar-gallery-slider">‹</a>
    <a class="carousel-control right" data-slide="next" href="#sidebar-gallery-slider">›</a>

    The gallery in the post list is coming from partials/content-gallery.php because index.php is calling get_template_part( '/partials/content', get_post_format() );. The single post is coming from single.php which uses 'single' instead of calling get_post_format, which gets it partials/content-single.php. That's why single returns images inline in my test. If you can get the test I described working, you should be able to write modify single.php (in a child theme) or content-single.php (in a child theme) and get a slider for gallery post types if that's what you prefer.

    Hopefully that helps. If not, please put up a test site and post a link to it here.

  3. athenagold
    Member
    Posted 1 year ago #

    jmjf, thank you so much!

    Thanks to your detailed description, I figured out exactly which step I was doing incorrectly: instead of simply inserting multiple photos into my post, I was trying to use the 'Create Gallery' option in the Add Media dialog. As soon as I made this change the sliders started working both in the post list and in the widget.

    Many, many thanks for your help! I am very grateful :-)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic