Home Forums Themes Support How to show Image Title (information) in WordPress

Tagged: 

This topic contains 0 replies, has 1 voice, and was last updated by  admin 2 months, 2 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2943

    Hi All Customer,

    In this topic tutorial we’ll help you show title or other information of an Image in WordPress.

    In this example we’ll show image title of our Haru Images Gallery shortcode (similar you can show with other image)

    Step 1: To customize any template of theme or our plugin you should know about use child theme to customize here:

    How to customize WordPress theme using Child theme

    Step 2: You need edit image and set information like this:

    Step 3: Find the template you need to customize. In this example it is: wp-content/plugins/templates/images-gallery/ then open file slick.php as example.

    Use this code to display title or caption of image:

    <h6><?php echo wp_get_attachment_caption($image['image']); ?></h6>
    <h6><?php echo get_the_title($image['image']); ?></h6>

    Here is the result at frontend:

    Hope this help!

    P/s: Here is reference link: http://thiagodiezel.com/sowp/function-to-get-an-attachments-caption-title-alt-description

     

    ******

    Best regards,

    HaruTheme

    • This topic was modified 2 months, 2 weeks ago by  admin.
    • This topic was modified 2 months, 2 weeks ago by  admin.
    • This topic was modified 2 months, 2 weeks ago by  admin.
    • This topic was modified 2 months, 2 weeks ago by  admin.
    • This topic was modified 2 months, 2 weeks ago by  admin.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.