• Can someone tell me what’s wrong with my widget?

    <?php
    /*
    Plugin Name: My widget
    Description: Adds a sidebar widget to let users emplment myplugin without editing the template.
    Author: Nate
    Version: 0.2
    Author URI: http://experiencetheweb.info
    */
    function widget_mywid($args) {
        extract($args);
    ?>
            <?php echo $before_widget; ?>
                <?php echo $before_title
                    . 'My Widget'
                    . $after_title; ?>
                <?php my_function() ?>
    
            <?php echo $after_widget; ?>
    <?php
    }
    register_sidebar_widget('My Widget','mywid');
    ?>
Viewing 1 replies (of 1 total)
  • I am no php wizard. I might be wrong, but…

    Are you sure that that something like

    <?php function xyz() { ?>
    <?php … ?>
    <?php } ?>

    will work?

    It looks so strange. How is the first php code going to be executed? Should you not enclose the WHOLE function/code inside the same <?php … ?> or what?

Viewing 1 replies (of 1 total)

The topic ‘What’s wrong with this widget?’ is closed to new replies.