Plugin Author
anmari
(@anmari)
1) you cannot put a shortcode into html or php code – shortcodes are only understood by wordpress itself in the post content field and in certain other situations.
2) So you do cannot use this plugin that way
3) You do NOT need my plugin at all, however you will have to pass any arguments to the widget code your self in your code if you are using anything other than the default.
Read here:
http://codex.wordpress.org/Function_Reference/the_widget
Thank you for reply anmari,
But I did not understand custom widget. Can you look at screenshot?
http://i.hizliresim.com/YPgdmE.png
<?php the_widget( ‘My_Custom_Widget’, $instance, $args ); ?>
What I must write for My_Custom_Widget ?
Thank you sincerely
Plugin Author
anmari
(@anmari)
Hi, please read the link:
http://codex.wordpress.org/Function_Reference/the_widget
it is not possible for me to teach you wordpress and php via support forum posts. In the link it clearly states how to set up the variables for the function calls.
for the widget rather obviously you need the class name of the widget you are trying to use.
Some example, if it can help someone:
<?php echo do_shortcode(‘[do_widget “bwp recent comments”]’); ?>
Plugin Author
anmari
(@anmari)
Actually, stagger lee, if you are coding in php, a more direct way would be NOT to use this plugin at all and rather call the widget directly (you will of course need to pass the arguments to the widget):
<?php the_widget( $widget, $instance, $args ); ?>
See
http://codex.wordpress.org/Function_Reference/the_widget
Yes man, you are right. As soon i posted i became aware of this, but didnt want to delete comment.
I was playing with one test development website and had this option, between many others, for what i needed your plugin.
Your plugin is good to prevent widget showing in all other registered sidebars, footer, etc. Without touching theme files to much. Themes dont have one hidden sidebar where you can hide widget and show it via code in PHP template. It can shows somewhere where you dont want if it as active. Dynamic widget fix that, but with your plugin is easier in those circumstances.
Or it is maybe better to register whole new sidebar in functions.php and not use it in PHP files anywhere.
Tell me just one thing bit different from this topic.
Can one widget be called in PHP template if it is on the list of inactive widgets, but this list that holds all setting at the bottom ?
I need to test it, but your answer is welcome.