Friday, July 11, 2014

How to render jwplayer in custom wordpress widget?

Recently while working on  wordpress news site i need to load jwplayer plugin to render there video. Wordpress jwplayer plugin working awesome in both content and text widget, but in my case i need to load it in my custom widget. i tried many ways but when i use the_content() in my widget jwplayer short code not replaced . i spend more time on this issue and i planned to load it from text widget like below

So in my widget i render the_content() like this

$content = get_the_content();
$content = apply_filters('the_content', $content);
the_widget( 'WP_Widget_Text', array('text' => $content));


it's working fine i am not sure is there any other way but the current one working awesome. hope this help some one or any one have other idea please share in comment.


No comments:

Post a Comment