Example code wordpress widget


/ Published in: PHP
Save to your folder(s)

put "register_sidebar_widget(..)" into "function widgets_init()"


Copy this code and paste it in your HTML
  1. function widget_myuniquewidget($args) {
  2.  
  3. extract($args);
  4. ?>
  5. <?php echo $before_widget; ?>
  6. <?php echo $before_title
  7. . 'My Unique Widget'
  8. . $after_title; ?>
  9. Hello, World!
  10. <?php echo $after_widget; ?>
  11. <?php
  12.  
  13. }
  14.  
  15. register_sidebar_widget( 'My Unique Widget', 'widget_myuniquewidget' );

URL: http://automattic.com/code/widgets/plugins/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.