NextGen Smooth Gallery:Showing a gallery based on custom field ID - Wordpress Solution
[Solved] - NextGen Smooth Gallery:Showing a gallery based on custom field ID - Wordpress Solution |
---|
Try following codes |
I have a custom field in my code called 'gallery' which holds the album ID from NextGen Gallery.
What I would like to do is parse that through to NextGen Smooth Gallery so it'll display the gallery alongside the post.
I have the following at the top:
And I've been trying to call it using: But all it does is show [smooth=id$3]. (3 being the ID) What am I doing wrong? Just uploaded the source code to [[LINK href="http://pastebin.com/m59df2a28"]]http://pastebin.com/m59df2a28[[/LINK]] and you can view it at [[LINK href="http://wordpress.geek.nz/logan/test/"]]http://wordpress.geek.nz/logan/test/[[/LINK]] Solution - 1This doesn't work because what you put in your post ( [smooth=id:yyy;] ) isn't a shortcode. It's just a filter on the_content :) Just make a custom loop using wp_query where you want to display your gallery and insert just the one page that has [smooth=id:yyy;] in it. After that exclude that page from the menu and you should be set... sort of... Or just use a different gallery plugin for nextgen: http://www.cozmoslabs.com/2010/01/13/wordpress-photo-slideshow/ It can be modified quite a lot ( it's based on http://spaceforaname.com/galleryview ) Solution - 2I can't get this plugin working (keeps saying it only works with NextGen Gallery - which I have instaled), so I can't test the code. I looked through the code and like Cristian said it adds a function to the content filter, so I thing this should work: Later Edit: a bit of update, a check to be sure if the $gallery is set. Solution - 3This should work (hope so). Give it a try...
|
Date: 2022-10-21 05:23:23 |
Category: Wordpress |