• I use wp plugin Az index for alphabetical catalog and want to add post thumbnails. For this I need correct thumbnail function for thumb image link. In the developer sample it works with custom field and looks as:

    $thumb = get_post_custom_values(‘Thumb’, $item[‘id’]);

    In my code I want to use theme’s thumbnail function:

    $thumb = get_the_post_thumbnail;

    Tried different variants, no result. Displays broken image (other thumb plugins work correctly).

    Can somebody help me please? What is mistake?

Viewing 2 replies - 1 through 2 (of 2 total)
  • you possibly only need to get the post thumbnail url;

    http://ww.wp.xz.cn/support/topic/getting-post-thumbnail-url?replies=12

    Thread Starter Ashanti

    (@ashanti)

    Thank you for reply, but it doesn’t working. I
    My code (in functions.php) for this is:

    add_filter(‘azindex_display_item’, ‘my_add_thumb’, 10, 2);
    function my_add_thumb($item, $idindex) {
    $thumb = get_the_post_thumbnail;
    $item[‘head’] = ‘<div style=”height:150px;padding-top:30px;”>’.$item[‘subhead’].'</div>’;
    $item[‘head’] = “<img src='{$thumb[0]}’/>”;

    It changes subhead to thumb. Any ideas will be usefull.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding thumbnails to AZ index’ is closed to new replies.