• 20-02-2018, 17:23:30
    #1
    function the_post() {
    global $wp_query;
    $wp_query->the_post();
    }
    bu fonksiyon değişkene atanabilir mi sizce?
  • 20-02-2018, 22:38:57
    #2
    function the_post() {
    global $wp_query;
    return $wp_query->the_post();
    }
    $degisken = the_post(); //değiskene atadım
  • 20-02-2018, 23:05:17
    #3
    $wp_query->the_post() fonksiyonun sonucunuda direk ekrana basıyor ise the_post methodunu bulup direk o methotdan return edebilirsin. fakat orası öyle olmak zorunda diyorsan şöyle birşey kullanabilirsin.

    function the_post() {
         global $wp_query;
         ob_start();
         $wp_query->the_post();
         $out = ob_get_contents();
         ob_end_clean();
         return $out;
    }
    
    $the_post = the_post();
    echo $the_post;
  • 21-02-2018, 21:59:39
    #4
    hocalarım ikisi de olmadı. aşağıda bu fonksiyon çağırılıyor. değişkene atamam konusunda başka yöntem varmıdır?
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    yassey adlı üyeden alıntı: mesajı görüntüle
    $wp_query->the_post() fonksiyonun sonucunuda direk ekrana basıyor ise the_post methodunu bulup direk o methotdan return edebilirsin. fakat orası öyle olmak zorunda diyorsan şöyle birşey kullanabilirsin.

    function the_post() { global $wp_query; ob_start(); $wp_query->the_post(); $out = ob_get_contents(); ob_end_clean(); return $out; } $the_post = the_post(); echo $the_post;
    crooper adlı üyeden alıntı: mesajı görüntüle
    function the_post() { global $wp_query; return $wp_query->the_post(); } $degisken = the_post(); //değiskene atadım