Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter emelgosa

    (@emelgosa)

    This is what my filter output looks like

    add_filter( 'post_gallery', 'my_post_gallery', 10, 2 );
    function my_post_gallery( $output, $attr) {
    
    $output = '
                 <section class="gallery portfolio-square">
                    <div class="portfolio-items-wrap">
                        <div class="flexslider carousel">
                            <ul class="slides">';
    $images = explode(',', $attr['include']);
    foreach ($images as $id){
        $attachment = get_post($id);
    $output .= '
                                <li class="carousel-item fromblog-post portfolio-square">
                                <a href="'.wp_get_attachment_url( $id ).'" title="'.$attachment->post_excerpt.'">
                                    '.wp_get_attachment_image( $id, "square").'
                                </a>
                                </li>  ';
    }
    $output .= '
                            </ul>
                        </div>
                        </div>
                    </div>
                </section>  ';
    
    //$output = print_r($images);
    return $output;
    }

    in the posted code, you are opening two divs:

    'section' 'div' 'div' 'ul'

    but are closing three divs:

    '/ul' '/div' '/div' '/div' '/section';

    Thread Starter emelgosa

    (@emelgosa)

    Thank you for the extra eyes. That fixed it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘HELP – Page content div closes after 5 galleries’ is closed to new replies.