Forums

[resolved] Custom [gallery] shortcode markup (3 posts)

  1. nnash
    Member
    Posted 1 year ago #

    I'm currently in the process of outfitting nivo-slider to work with gallery images from posts. I'm using the below code in conjunction with the Cleaner Gallery WordPress plugin.

    <?php
    echo do_shortcode('[gallery]');
    ?>

    The issue I'm running into is that the gallery shortcode is adding all of this markup that I do not want. What I would like to know is if it is possible to strip the html markup that is associated with the following classes from being parsed.

    .gallery {}
    .gallery .gallery-row {}
    .gallery .gallery-item {}
    .gallery .gallery-item img, .gallery .gallery-item img.thumbnail {}
    .gallery-caption {}

    All that I want to be injected into the markup are a simple, non-listed set of images from the gallery like so:

    <img src="foo" alt="bar" width="0" height="0" />
    <img src="foo" alt="bar" width="0" height="0" />
    <img src="foo" alt="bar" width="0" height="0" />

    Any help would be greatly appreciated, thanks.

  2. nnash
    Member
    Posted 1 year ago #

    bump

  3. nnash
    Member
    Posted 1 year ago #

    Actually instead of figuring out how to remove the unnecessary markup from wordpress's shortcodes it is easier to just make your own.

    This resource helped me:
    http://www.aldenta.com/2009/05/05/programmatically-pull-attachments-from-wordpress-posts/

Topic Closed

This topic has been closed to new replies.

About this Topic