Hello Guys,
Has anybody been able to get the couch instagram shortcode to work? I added the following code to the 'couch/addons/kfunctions.php' file :
and added the shortcode to my richtext textbox like so :
Has anybody been able to get the couch instagram shortcode to work? I added the following code to the 'couch/addons/kfunctions.php' file :
- Code: Select all
// Instagram shortcode
// Example usage:
// [instagram BoGOAK_gLYq]
$FUNCS->register_shortcode( 'instagram', 'instagram_handler' );
function instagram_handler( $params, $content=null ){
global $FUNCS;
extract( $FUNCS->get_named_vars(array(
'id' => '',
), $params) );
$html = '';
$id = trim( $id );
if( strlen($id) ){
$url = 'https://api.instagram.com/oembed/?url='.urlencode( 'https://www.instagram.com/p/'.$id );
$res = $FUNCS->file_get_contents( $url );
if( strlen($res) ){
$res = $FUNCS->json_decode( $res );
if( isset($res['html']) ){
$html = $res['html'];
}
}
}
return $html;
}
and added the shortcode to my richtext textbox like so :
- Code: Select all
[instagram BoGkRY3FBYv]
- Code: Select all
<cms:do_shortcodes><cms:show news_content /></cms:do_shortcodes>