Forums

Nextgen custom fields (1 post)

  1. trueplayers
    Member
    Posted 1 year ago #

    hi, i was wondering if someone could tell me how to do this... at the moment i am using

    <?php $gallery = get_post_meta($post->ID, 'gallery', true); ?>
    <?php
    $gal = $gallery;
    $gal = apply_filters('the_content', $gal );
    echo $gal;
    ?>

    and then this in the value for the custom field

    <h4 class="g-title">Gallery</h4>
    <h4 class="g-content">[gallery=2]</h4>

    My question is, how can i shorten the value so i only have to enter the gallery number as everything else is the same every time, but the classes should only be called if the custom field is set.

    Thanks for any help.

Topic Closed

This topic has been closed to new replies.

About this Topic