Support » Fixing WordPress » [Plugin: Next-Gen Gallery] Singlepic caption

  • Is it posible to have the description/caption show up for an image using the singlepic option?

    Something like this:
    [ singlepic id=1 caption=desc w=480 h=320 ]

Viewing 8 replies - 1 through 8 (of 8 total)
  • We also need to display the description when singlepic is used in a post.
    Any ideas what files to change to get this working?

    I badly need this functionality. I was so sad when I found out there was no obvious way to do that. It would make like so much easier!

    Any news on this feature?

    First of all, I am not – by any means – a PHP or WP whiz. I tinkered around with the NGG template files/code until I found a solution that works for me. I hope this at least might get you close to what you are trying to achieve.

    My Solution:

    Step 1. Open the Singlepic.php template file:

    nextgen-gallery > views > singlepic.php

    Step 2. Rename the singlepic.php file to something else like singlepic-caption.php
    (The hyphen caption seems to be the right way to rename the template files. You might find another way to name the files, but this seems to work well for me.)

    Step 3. Add the following PHP call to the code after line 21 of the above file (or really, wherever you want the text to be displayed):

    <?php echo $image->alttext; ?>


    <?php echo $image->description; ?>

    ***NOTE*** I found the alttext version seems to display a little better on my server for some reason. Give both a shot to see which works better for you.

    At this point you should be able to style as needed.

    Step 4. Upload the renamed/edited file to your server.

    Step 5. In a WP post or page, use a new singlepic shortcode including the name of your new template like this:

    [singlepic id=1 template=caption]

    This solution seemed to work for me. I hope it works for you – Good luck!

    ***UPDATE*** Just thought of this: If you are using Float in your single pic shortcode, you may need to style the above call with matching right or left floats in the template/style and then create seperate templates to correspond to your singlepic shortcode float. Again, good luck!

    hey bentforkz, thank you for this information. I was able to get the caption to show up on the singlepix. However, I don’t know how to style it. The caption is too far to the left, not aligned under the photo. I’m using ngg_shadow.css. Do you know what code and where to add it? I tried this:

    .ngg-singlepic-caption {
    text-align: center;
    background-color: #f3f3f3;
    padding-top: 4px;
    margin:0 0 0 118px;
    /* -moz-border-radius: 3px;
    -khtml-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px; */

    I also tried “.ngg-singlepic caption”, but it didn’t work. I hope you know what I’m doing wrong. Thanks a lot!

    bentforkz, Thank you!! This was exactly what I was looking for. 🙂

    typebee, this is what I did to style the singlepic with caption:

    <div align=”center”>
    <div class=”ngg-thumbnail”>
    [singlepic id=57 template=caption w=270]

    Looks like this feature will never make it to actual code. 🙁

    Any ideas how to get the damn “description” to display under the image so that we do not have to add div tags in to articles?

    Can you give us detailed instructions how to edit singlepic-caption.php.

    Thank you.

    Sorry to bump this one.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Next-Gen Gallery] Singlepic caption’ is closed to new replies.