Sintax meta property tidak terdeteksi saat saat di share di media sosial, jika uri 1 dan uri 2 dihilangkan.Dibuat
Login Terakhir
2 Tahun lalu,
Telah Dilihat 1161 Kali
| |
Sultan Account |
|
|
Adrie saputra
Mengatakan :
Sultan Account
Assalamualaikum Warahmatullahi Wabarakatuh...
<?php if ($this->uri->segment(1) == 'berita' and $this->uri->segment(2) == 'detail') {
$rows = $this->model_utama->view_where('tbl_berita', array('judul_seo' => $this->uri->segment(3)))->row_array();
echo ' <meta property="fb:app_id" content="370055223146291" />
<meta property="og:title" content="' . $title . '" />
<meta property="og:type" content="article" />
<meta property="og:url" content="' . base_url() . ' ' . $this->uri->segment(3) . '" />
<meta property="og:image" content="' . base_url() . 'assets/img_post/' . $rows['gambar'] . '" />
<meta property="og:description" content="' . $description . '"/>';
}
?> |
|
| Adrie saputra commented on 14 Sep 2019 16:06:21 Sultan Account |
|
|
|
Assalamualaikum,.. Apakah karena update ini pak Roby : - URL Berita menjadi 1 Segment (Similar to wordpress) |
|
| PHPMU.COM Support commented on 15 Sep 2019 06:21:22 Sultan Account |
|
|
|
Assalamualaikum,.. iya benar masalahnya disana, ganti jadi seperti ini saja mas :
<?php
$berita = $this->model_utama->view_where('berita',array('judul_seo' => $this->uri->segment(1)));
if ($berita->num_rows()>=1){
$rows = $berita->row_array();
echo '<meta property="og:title" content="'.$title.'" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'" />
<meta property="og:image" content="'.base_url().'asset/foto_berita/'.$rows['gambar'].'" />
<meta property="og:description" content="'.$description.'"/>';
}
?> |
|