Stefan Di Iorio
asked 9 years ago

I’m curious how to go about calling the dw-focus-slider (or dw_focus_top_posts object) from code.
Thanks.

Stefan Di Iorio
replied 9 years ago

So far, this is the best I could do.

$myslider = new dw_focus_top_posts();
$instance[‘number’] = 5;
echo “

“;
echo $myslider->widget($args, $instance);
echo “

“;

1 Answers
BigHug
answered 9 years ago

Hi Stefan,

You can use the_widget() function that was made by WordPress ( http://codex.wordpress.org/Function_Reference/the_widget ). It’s the shortest way to call a widget outside of a sidebar.
Regards

Powered by DW Question & Answer Pro