Haloo! Selamat Datang di Komunitas Private Training Web Development (54270 Members, 616 Products, 4281 Topic, 11375 Comments)

Butuh karyawan baru? atau seorang Web Developer (Part-time/Freelance/Full-time), cari disini : Members Area Jobs!

Sintax meta property tidak terdeteksi saat saat di share di media sosial, jika uri 1 dan uri 2 dihilangkan.

Dibuat
Login Terakhir 12 Hari lalu,
Telah Dilihat 171 Kali
Adrie saputra Mengatakan : Premium
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2.  
  3. <?php if ($this->uri->segment(1) == 'berita' and $this->uri->segment(2) == 'detail') {
  4. $rows = $this->model_utama->view_where('tbl_berita', array('judul_seo' => $this->uri->segment(3)))->row_array();
  5. echo ' <meta property="fb:app_id" content="370055223146291" />
  6. <meta property="og:title" content="' . $title . '" />
  7. <meta property="og:type" content="article" />
  8. <meta property="og:url" content="' . base_url() . ' ' . $this->uri->segment(3) . '" />
  9. <meta property="og:image" content="' . base_url() . 'assets/img_post/' . $rows['gambar'] . '" />
  10. <meta property="og:description" content="' . $description . '"/>';
  11. }
  12. ?>

Ada 2 Jawaban

Adrie saputra
commented on 14 Sep 2019 16:06:21
  1. Assalamualaikum,..
  2. Apakah karena update ini pak Roby :
  3. - URL Berita menjadi 1 Segment (Similar to wordpress)
PHPMU.COM Support
commented on 15 Sep 2019 06:21:22
  1. Assalamualaikum,.. iya benar masalahnya disana, ganti jadi seperti ini saja mas :
  2. <?php
  3. $berita = $this->model_utama->view_where('berita',array('judul_seo' => $this->uri->segment(1)));
  4. if ($berita->num_rows()>=1){
  5. $rows = $berita->row_array();
  6. echo '<meta property="og:title" content="'.$title.'" />
  7. <meta property="og:type" content="article" />
  8. <meta property="og:url" content="http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'" />
  9. <meta property="og:image" content="'.base_url().'asset/foto_berita/'.$rows['gambar'].'" />
  10. <meta property="og:description" content="'.$description.'"/>';
  11. }
  12. ?>
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!