• 21-10-2008, 19:06:50
    #1
    Merhaba

    function get_the_image($arr = false, $default_size = 'medium', $default_img = false) {
    wp temasında bu kod hata veriyor sürekli bu ne işe yarar hata sebebi nedir bir yardım edin nolur
  • 21-10-2008, 19:08:18
    #2
    bu arada verilen hata

    Fatal error: Cannot redeclare get_the_image()
  • 21-10-2008, 19:17:53
    #3
    şunu denermisin bi

    if(!function_exists('get_the_image')){
      function get_the_image($arr = false, $default_size = 'medium', $default_img = false) {
        ......
      }
    }
  • 21-10-2008, 19:36:02
    #4
    Parse error: syntax error, unexpected '}'
  • 21-10-2008, 19:38:12
    #5
    yeni Hali:
    Alıntı
    /************************************************** *********
    Catchall function for getting images
    ************************************************** *********/
    if(!function_exists('get_the_image')){
    function get_the_image($arr = false, $default_size = 'medium', $default_img = false) {
    }
    }
    global $post;
    $cf_array = load_the_image($arr, $post, $default_size);
    $image = display_the_image($cf_array, $post, $default_size, $default_img);
    if($image == false) $image = '<!-- No images were added to this post. -->';
    return $image;
    }
    son ayracta hata veriyor
    eski hali:
    Alıntı
    /************************************************** *********
    Catchall function for getting images with a link
    ************************************************** *********/
    function get_the_image_link($arr = false, $default_size = 'medium', $default_img = false) {
    global $post;
    $cf_array = load_the_image($arr, $post, $default_size);
    $image = display_the_image($cf_array, $post, $default_size, $default_img);

    if($image == false) :
    $image_link = '<!-- No images were added to this post. -->';
    else :
    $post_perm = get_permalink($post->ID);
    $image_link = "<a href=\"$post_perm\" title=\"$post->post_title\">$image</a>";
    endif;
    return $image_link;
    }
  • 21-10-2008, 23:44:28
    #6
    Fatal error: Cannot redeclare get_the_image()
    Bu hatayı vermesinin sebebi aynı isimde fonksiyon 2 kere tanımlanmaya çalışıyor. Kullandığınız pluginler de böyle bir fonksiyon tanımlanmış olabilir. Eğer tanımlanmadığına eminseniz aşağıdaki işinizi görecektir.

    if(!function_exists('get_the_image')){
        function get_the_image($arr = false, $default_size = 'medium', $default_img = false) {
            global $post;
            $cf_array = load_the_image($arr, $post, $default_size);
            $image = display_the_image($cf_array, $post, $default_size, $default_img);
            if($image == false) $image = '<!-- No images were added to this post. -->';
            return $image;
        }
    }