• So I have built a Custom Post Type business directory and I am using Custom Fields Template to input the information.

    I found that using a custom field to input the built in WordPress gallery doesn’t work unless you put an apply_filter to it, of which I found this code and edited (to the best of my ability) to my needs. I got the gallery to show up, but the images link only to an attached page, no matter if I choose “attack to file” when inserting the gallery.

    Is there something I can include into the code to ensure that attaches to file no matter what?

    <?php $gallery = getCustomField($post->ID, 'gallery', true); ?>
            <?php
                $gal = '[gallery='.$gallery.']';
                $gal = apply_filters('the_content', $gal );
                echo $gal;
            ?>
  • The topic ‘Gallery Not Linking Properly’ is closed to new replies.