WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: NextGEN Gallery] using Custom Fields to show gallery ID (10 posts)

  1. vachi
    Member
    Posted 6 years ago #

    I wanna be able to call on the gallery ID from the custom field area
    meaning i have a custom field called gallery, in there i write [gallery=74]

    than in the loop i want to show the gallery specified by that id
    the code i have right now is
    <div class="actor_gallery"><?php $gallery = get_post_meta($post->ID, 'gallery', true); ?><?php echo $gallery ?></div>
    but this gives me a simple text output ([gallery=74])
    any ideas on how this can be done?

  2. vachi
    Member
    Posted 6 years ago #

    i am sorry for bumping it, but its been some time now i hope i am not getting in trouble, (like always) for bumping :)

    i thought i some ways of doing this but still no luck, any one have any ideas?

  3. Michael Torbert
    WordPress Virtuoso
    Posted 6 years ago #

    It outputs it literally because NextGen only looks into the post's content.

    This may work...
    apply_filters('the_content',
    http://codex.wordpress.org/Function_Reference/apply_filters

  4. Anonymous
    Unregistered
    Posted 6 years ago #

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

    My code for my site :P

  5. vachi
    Member
    Posted 6 years ago #

    works perfect krickett, tx alot i read up on the apply_filters, tx hallsofmontezuma

    hallsofmontezuma --> i also checked out your site, nicely done, i like the nice big visible buttons clean web2.0 feel of it

    resolved tx people

  6. alkafy
    Member
    Posted 5 years ago #

    Thank you for this!

  7. enoyad
    Member
    Posted 5 years ago #

    Thanks!

  8. viter-z-bayraku
    Member
    Posted 5 years ago #

    Thank You!!

  9. betadog
    Member
    Posted 5 years ago #

    Thanks, this is exactly what I was looking for!

  10. mmoran0226
    Member
    Posted 5 years ago #

    This is why the WordPress community is the best!!! BUMP BUMP BUMP. I struggled with this for two days now before I found this thread. Works perfect.

    I wasn't having the exact same problem, because i had found a way to call the slideshow, but the images in my slideshows were switching back and forth and it was really getting annoying. This fixed the call and prevents duplicates somehow too.

    THANK YOU THANK YOU THANK YOU

Topic Closed

This topic has been closed to new replies.

About this Topic