• 11-08-2012, 05:07:20
    #1
    Fatal error: Call to undefined function the_content_limit() in

    Limit post eklenditisini kurup aktif ettim, kategorilerde eklenticalisiyor fakat, anasayfadaki konularin altinda boyle cikiyor. Bu konuda ne yapmam gerek?
  • 11-08-2012, 10:48:47
    #2
    Spew adlı üyeden alıntı: mesajı görüntüle
    Fatal error: Call to undefined function the_content_limit() in
    Limit post eklenditisini kurup aktif ettim, kategorilerde eklenticalisiyor fakat, anasayfadaki konularin altinda boyle cikiyor. Bu konuda ne yapmam gerek?
    aşağıdaki kodu <h2>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></h2>
    bu kodun yanına koydunmu ?
    <?php the_content_limit(125, "devamını oku »"); ?>
  • 11-08-2012, 15:47:34
    #3
    Bu sekilde duruyo zaten.

    Sanirim kodda sorun var, ekleyince " id="post- boyle cikiyo.

    <div class="img"><?php $resim = get_post_meta($post->ID,'resim', true); ?><a href="<?php the_permalink(); ?>" target="_self" title="<?php the_title(); ?>"><img src="<? echo $resim; ?>" alt="<?php the_title(); ?>" /></a></div>
    <div class="baslik"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
    <div class="aciklama">
    <?php the_content_limit(270, ""); ?>
  • 11-08-2012, 19:12:31
    #4
    Spew adlı üyeden alıntı: mesajı görüntüle
    Bu sekilde duruyo zaten.
    Sanirim kodda sorun var, ekleyince " id="post- boyle cikiyo.
    <div class="img"><?php $resim = get_post_meta($post->ID,'resim', true); ?><a href="<?php the_permalink(); ?>" target="_self" title="<?php the_title(); ?>"><img src="<? echo $resim; ?>" alt="<?php the_title(); ?>" /></a></div>
    <div class="baslik"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
    <div class="aciklama">
    <?php the_content_limit(270, ""); ?>
    peki bu kodu denermisin o eklentiyi pasif yap hocam ve aşağıdaki kodları kaydet dosyalara

    functions.php dosyasına kaydet bunu
    function excerpt($num) {
    2.
    $limit = $num+1;
    3.
    $excerpt = explode(' ', get_the_excerpt(), $limit);
    4.
    array_pop($excerpt);
    5.
    $excerpt = implode(" ",$excerpt)."...";
    6.
    echo $excerpt;
    7.
    }
    bu kodu index.php de bul
    <?php the_content_limit(270, ""); ?>
    şununla değştir :
    <?php excerpt('270'); ?>
    birde böyle dene bakalım
  • 11-08-2012, 20:08:45
    #5
    Kimlik doğrulama veya yönetimden onay bekliyor.
    byemrah adlı üyeden alıntı: mesajı görüntüle
    peki bu kodu denermisin o eklentiyi pasif yap hocam ve aşağıdaki kodları kaydet dosyalara

    functions.php dosyasına kaydet bunu
    function excerpt($num) {
    2.
    $limit = $num+1;
    3.
    $excerpt = explode(' ', get_the_excerpt(), $limit);
    4.
    array_pop($excerpt);
    5.
    $excerpt = implode(" ",$excerpt)."...";
    6.
    echo $excerpt;
    7.
    }
    bu kodu index.php de bul
    <?php the_content_limit(270, ""); ?>
    şununla değştir :
    <?php excerpt('270'); ?>
    birde böyle dene bakalım
    Verdiginiz kod ile the_content iligisi yok!


    the_content_limit calisabilmesi icin functions.php dosyasina asagidaki kodu eklemelisiniz

    function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { 
    $content = get_the_content($more_link_text, $stripteaser, $more_file); 
    $content = apply_filters('the_content', $content); 
    $content = str_replace(']]>', ']]&gt;', $content); 
    $content = strip_tags($content); 
    
    if (strlen($_GET['p']) > 0) { 
    echo "<p>"; 
    echo $content; 
    echo "&nbsp;<a href='"; 
    the_permalink(); 
    echo "'>"."Devami &rarr;</a>"; 
    echo "</p>"; 
    } 
    else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { 
    $content = substr($content, 0, $espacio); 
    $content = $content; 
    echo ""; 
    echo $content; 
    echo "..."; 
    echo "&nbsp;<a href='"; 
    the_permalink(); 
    echo "'>".$more_link_text."</a>"; 
    echo ""; 
    } 
    else { 
    echo "<p>"; 
    echo $content; 
    echo "&nbsp;<a href='"; 
    the_permalink(); 
    echo "'>"."Devami &rarr;</a>"; 
    echo "</p>"; 
    } 
    }
  • 11-08-2012, 21:50:44
    #6
    270 yazan yeri 300 le değiştirirmisin.
  • 12-08-2012, 01:26:55
    #7
    TekimNet adlı üyeden alıntı: mesajı görüntüle
    Verdiginiz kod ile the_content iligisi yok!
    the_content_limit calisabilmesi icin functions.php dosyasina asagidaki kodu eklemelisiniz
    function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { 
    $content = get_the_content($more_link_text, $stripteaser, $more_file); 
    $content = apply_filters('the_content', $content); 
    $content = str_replace(']]>', ']]&gt;', $content); 
    $content = strip_tags($content); 
    if (strlen($_GET['p']) > 0) { 
    echo "<p>"; 
    echo $content; 
    echo "&nbsp;<a href='"; 
    the_permalink(); 
    echo "'>"."Devami &rarr;</a>"; 
    echo "</p>"; 
    } 
    else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { 
    $content = substr($content, 0, $espacio); 
    $content = $content; 
    echo ""; 
    echo $content; 
    echo "..."; 
    echo "&nbsp;<a href='"; 
    the_permalink(); 
    echo "'>".$more_link_text."</a>"; 
    echo ""; 
    } 
    else { 
    echo "<p>"; 
    echo $content; 
    echo "&nbsp;<a href='"; 
    the_permalink(); 
    echo "'>"."Devami &rarr;</a>"; 
    echo "</p>"; 
    } 
    }

    Ise yaradi fakat, devami filan yazilarini kaldirdigimda haya veriyor. limit post eklentisinde zaten devami diye birsey yazabiliyorum bunu burdan kaldirsakda oyle eklesek?