To Share blog or Information over social media like facebook, twitter or linked in for degital marketing of your project in codeigniter, You need to follow following steps:
STEPS TO SHARE PAGES OVER SOCIAL MEDIA :
<meta property="og:url" content=""/>
<meta property="og:image" content=""/>
<meta property="og:title" content="" />
<meta property="og:description" content="" />
<meta property="og:url" content="<?php if(isset($url) && !empty($url)){echo $url;}?>"/>
<meta property="og:image" content="<?php if(isset($img) && !empty($img)){echo $img;}?>"/>
<meta property="og:title" content="<?php if(isset($title) && !empty($title)){echo $title;}?>"/>
<meta property="og:description" content="<?php if(isset($meta_desc) && !empty($meta_desc)){echo $meta_desc;}?>"/>
<a id="facebook" href="http://www.facebook.com/sharer.php?u=<?php echo base_url()?>your_controller_page" class="fa fa-facebook border-icon rounded-icon" target="_blank""></a>
<a id="twitter" href="https://twitter.com/share?url=<?php echo base_url()?>your_controller_page" class="fa fa-twitter border-icon rounded-icon" target="_blank""></a>
<a id="Linkedin" href="https://linkedin.com/share?url=<?php echo base_url()?>your_controller_page" class="fa fa-linkedin border-icon rounded-icon" target="_blank""></a>
<?php
class PAGE extends CI_Controller {
public function index() {
$data['page_name'] = "page";
$this->load->view('layout/main_layout',$data);
}
}
?>
<?php
class PAGE extends CI_Controller {
public function index() {
$data['title']="page title";
$data['meta_desc']="page description";
$data['url'] = base_url("controller-page-name");
$data['img'] = base_url("assets/images/xyz/page.jpg");
$data['page_name'] = "view file page name";
$this->load->view('layout/main_layout',$data);
}
}
?>