Forums

[Plugin: NextGEN Gallery] Call 1 specific pic from a specific gallery dynamically (7 posts)

  1. mariostella
    Member
    Posted 1 year ago #

    Hello, first of all GREAT PLUGIN, really, I cannot tell how much I love this.
    Does anyone know how to call the first pic (or any pic) from a specific gallery DYNAMICALLY (this is really important)? I assume this needs to be done with extended php tags instead of the short tags.
    Basically I need to call in a specific post the pic that the user inserts in a gallery with a specific title. As I said the pic could be any pic or just the first.
    Since I am obliging the user to insert the title of the gallery exactly like the title of the post, I can foresee which gallery will be used for that specific post, but of course cannot foresee the name of any pic.
    Thanks in advance for any help

  2. filipeabreu
    Member
    Posted 1 year ago #

    For a single picture : [singlepic=id,width,height,mode,float]

    (extracted from the NextGen WP Plugin FAQ http://wordpress.org/extend/plugins/nextgen-gallery/faq/)

    Why don't you explain it a little better? A good use the have galleries or pics to be added "dynamically" is to make a Page with [album=ID,extend] or [album=ID,compact]. When a new gallery is created, add it to the album with the same ID you put on the page, and it will be added to the page too. You still need to make a post about this new gallery you made, if you want it to be in a post inside the loop. Use [singlepic=id,width,height,mode,float] to add the image uploaded to any gallery and add it's ID in the above short code.

    I also wanted to do something similar that you ask here, but the solution I just gave you is the one I figured out. You can also check out another plugin, the Inline Gallery ( http://wordpress.org/extend/plugins/inline-gallery/ ), but is not as powerful and complete as the NextGen Gallery.

    Perhaps someone can make a plugin that makes a post automatically when a gallery is created.

  3. mariostella
    Member
    Posted 1 year ago #

    Hi, thanks Filipeabreu, I'll explain a little better:

    My users must not interact with admin functions so much, also 'cause they don't really feel like to.. so I am just trying to achieve a no-brainer way to insert pictures for them not to have to explain "put the short code here, look for the gallery ID.." and so forth.

    Therefore I am obliging users to create their own gallery with a unique name (which will be the post title) so that I will be able to feed the code with the_title tag for the gallery name. To complete the whole matter I need a function that from that particular picture extracts whatever picture (could be any, even random) as I will not be able to foresee the filename of any picture users upload.

    I need all this because I want to show the thumb of the picture besides the post excerpt in the last written post page..or wherever I need it..

    Hope now it is clearer, and this also explains why short tags really do not work for this (including the one that you kindly suggested).

    Thanks for your reply..I hope you have any idea on this, 'cause I am clueless..even after trying to modify the plugin to accept complete php tags...

  4. alexrabe
    Member
    Posted 1 year ago #

    it's a interesting idea. It should be possible of a bit of code changes, but i'm working currently the next release and am couple of other project. Sorry, can assist you in this case...

  5. mariostella
    Member
    Posted 1 year ago #

    Ok, thanks for the reply...I will implement this at a later stage...however I realized that the short tag format does not allow for dynamic content within the short tag, therefore I cannot call the desired gallery (as stated above I am obliging the user to insert the title of the gallery equal to the post title, intending to call with the_title php tag). Additionally I have another problem. NextGen changes the name gallery from, for example, My Gallery to my_gallery by default. Now, this is another problem, as I cannot ask my users to title their posts with underscores instead of the spaces and write all lower case words...how can I bypass this? Thank you!

  6. alexrabe
    Member
    Posted 1 year ago #

    look in to function.php, there is the slug function for gallery titles

  7. mariostella
    Member
    Posted 1 year ago #

    Thank you, I have been doing some tweaking but how can I solve the short tag issue as specified in my previous post? Do I have to tweak something else in the function.php file? I need to convert the plugin from accepting short tags only into also/only accepting php tags.

Topic Closed

This topic has been closed to new replies.

About this Topic