• I’ve created a gallery-override in my functions.php which replaces the default gallery shortcode with a new function. It displays each photo vertically, full size, with title and description below…no problem so far, I’ve written the code, and it works great.

    Here’s the tricky part hopefully someone has a suggestion for.

    Between each photo, I would like to create a page break ( <!–nextpage–> ). I tried echoing the tag with my function, but the shortcode function obviously executes after the page has been rendered.

    Is anyone aware of a workaround here, or do I have to go in much deeper to make this happen?

Viewing 1 replies (of 1 total)
  • Thread Starter moguldomrich

    (@moguldomrich)

    Code Below

    remove_shortcode('gallery');
    add_shortcode('gallery', 'new_gallery_func');
    
    function new_gallery_func() {
        // echo image tag
        // echo title <h3>
        // echo description <p>
    
        // Want to insert a page break here
    
    }

Viewing 1 replies (of 1 total)

The topic ‘Creating a pagebreak within gallery function’ is closed to new replies.