WordPress.org

Forums

[resolved] Get title in thumbnail array (4 posts)

  1. baszer
    Member
    Posted 2 years ago #

    hello,

    is it possible to get the title of the post in the array?

    <img data-slider='<?php the_ID(); ?>'/> <?php the_post_thumbnail(
    	array(200, 200),
    	array(
    		'class' => 'thumbnail-slider',
    		'alt' => 'post thumbnail',
    		'title' => $title,
    		'data-slider' => $id
    	)
    ); ?>

    i get the ID, but not the title (I also tried $post-title)

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Try $post->post_title.

  3. baszer
    Member
    Posted 2 years ago #

    thanks esmi, did the trick!

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Excellent :-)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.