Support » Theme: WP-Forge » Turn on caption for featured image in posts?

  • mocreate

    (@mocreate)



    I was wondering if there’s a way to turn on captions for featured images in posts — I’ve researched a couple of articles on this topic, and while there’s a plugin, it hasn’t been supported in over two years. I’d rather modify the template with php, but not sure where to edit.

    I found this article but not sure how to integrate or if it’s the right solution for WP Forge. http://www.sourcexpress.com/how-to-add-caption-to-the-featured-images-in-wordpress/

    Any help appreciated!

    • This topic was modified 5 months ago by  mocreate.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Theme Author Thomas

    (@tsquez)

    Um featured images are supported in WP-Forge. I guess im not understanding the question?

    mocreate

    (@mocreate)

    I typed faster than my thoughts. I meant turning on captions in featured images so they show in posts. 🙂

    Theme Author Thomas

    (@tsquez)

    Sorry read that wrong…lol anywho, im sure there is a way to do it. Just do search for it and I believe youll find what your looking for.

    mocreate

    (@mocreate)

    There is — I just need to find where thepost_thumbnail is called.

    Theme Author Thomas

    (@tsquez)

    I dont know the exact file as i am not at home but if you do search on the theme folder you should be able to locate it or locate all the places its called.

    mocreate

    (@mocreate)

    Ah, no worries — found it — I’m using an older version of the theme (6.3.1.2), but in content.php, line 38:

    Before:

    <?php if ( is_single() ) : ?>
    <?php the_post_thumbnail(); ?>
    <?php endif; // end if ?>

    After:

    <?php if ( is_single() ) : ?>
    <?php the_post_thumbnail(); ?>
    <?php if ( $caption = get_post( get_post_thumbnail_id() )->post_excerpt ) : ?>
    <p class="caption"><?php echo $caption; ?></p>
    <?php endif; ?>
    <?php endif; // end if ?>
    • This reply was modified 5 months ago by  mocreate.
    • This reply was modified 5 months ago by  mocreate.
    Theme Author Thomas

    (@tsquez)

    Did this work out for you?

    mocreate

    (@mocreate)

    It did! Thank you for talking me through this. 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.