Support » Fixing WordPress » how to writte this properly to make it work [RESOLVED]

  • I am using yarp with my custom template and im having problems defining the thumbnail i get a parse error with php. Please help

    $related_thumbnail = bloginfo('template_directory').'/thumb.php?src='.echo get_post_meta($post->ID, "image_value", $single = true). '&h=105&w=150&zc=1';

Viewing 5 replies - 1 through 5 (of 5 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    get_bloginfo ?

    thnx for the quick reply alchymyth but even with that it doesn’t work i think i have a porblem with proper ‘ ” . in php

    Michael

    (@alchymyth)

    Forum Moderator

    didn’t look close enough first time:
    as you are working with the strings, there should be no ‘echo’ in the code.

    can i replace the whole .echo get_post_meta($post->ID, "image_value", $single = true). with a key for example
    $my_key = echo get_post_meta($post->ID, "image_value", $single = true);
    and than put the key in src = $my_key

    It worked like this, thnx for help

    $img_src = get_post_meta($post->ID, “image_value”, $single = true);
    $related_thumbnail = get_template_directory_uri().’/thumb.php?src=’. $img_src .’&h=105&w=150&zc=1′;

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to writte this properly to make it work [RESOLVED]’ is closed to new replies.