Advertisement
Guest User

Untitled

a guest
Nov 30th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.67 KB | None | 0 0
  1. heheh sry2 mas, saya udah ngantuk jadi blom sempet jabarin ke masnya.
  2.  
  3. Jadi, di single.php AMPnya
  4. saya mau manggil untuk nampilin konten yang ada di WP bagaimana yah mas ?
  5.  
  6. Contoh kode manggil konten di plugin AMP mas :
  7. <div amp-access="">
  8.             <?php $where = 3;
  9.                         $content = apply_filters("the_content", get_the_content());
  10.                         $content = explode("</p>", $content);
  11.                         $content = preg_replace("'.$fixreplace1.'", " ", $content);
  12.                         $content = preg_replace(\' '.$fixreplace2.' \', '.$fixreplace4.', $content);
  13.                         $content = preg_replace("/<iframe.*?>/", "Konten Video tersedia di <a target=\'_blank\' href=\'".get_the_permalink()."\'>".get_the_title()."</a>", $content);
  14.                         $content = str_replace("]]>", "]]>", $content);
  15.                         for ($i = 0; $i <count($content); $i++) {
  16.                             if ($i == $where) {;?>';
  17.                             if(!empty($adsid) && !empty($adslot)){
  18.                             $konten.= '<div class="ad">
  19.                                 <amp-ad class="fixed-height" width="300" height="250" type="adsense" data-ad-client="<?php echo get_option("zaenu_adsenseid")?>" data-ad-slot="<?php echo get_option("zaenu_adsenseslot")?>" data-amp-slot-index="0">
  20.                                     <div placeholder>
  21.                                     </div>
  22.                                 </amp-ad>
  23.                             </div>';
  24.                             }
  25.                             $konten.='<?php }
  26.                             echo $content[$i] . "</p>";
  27.                             };?>
  28.         </div>
  29.  
  30. Nah di kode mas di atas, postingan tidak muncul semua yang ada di blog saya.
  31.  
  32. Nah kalau saya, mau custom pemanggilan untuk tampilin konten itu gimana yah mas ? dan..
  33.  
  34. di thread mas buat, saya gagal tuh ngikutin petunjuk masnya, tidak tampil apa2 karena saya blom tau munculin tampilan konten di AMPnya.
  35.  
  36. Maka itu saya minta ke masnya untuk bisa lebih jelasin lagi hehehe :D
  37. matu suwun.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement