WordPress.org

Ready to get started?Download WordPress

Forums

Need help trying to add text (and link) to WordPress widget? (1 post)

  1. markbesada
    Member
    Posted 5 years ago #

    Before I start, I have NO formal experience coding, with CSS, PHP, or WordPress. However, I was able to cobble myself together a widget. However, I'm having trouble in what's probably a simple task, adding text and a link. Here's how the coding looks so far:

    function sampleHelloWorld()
    {
    echo "<h2>Hello World</h2>";
    }

    function widget_myHelloWorld($args) {
    extract($args);
    echo $before_widget;
    echo $before_title;?>See, Hear, Read: <?php echo $after_title;
    amm_getMedia('amm_my_first_go',10);
    echo $after_widget;
    }

    function myHelloWorld_init()
    {
    register_sidebar_widget(__('Hello World'), 'widget_myHelloWorld');
    }
    add_action("plugins_loaded", "myHelloWorld_init");
    ?>

    Where and how do I place the text/link. I'd like it to be the very first thing below the title (which, in this case is "See, Hear, Read:") Thanks so much!

Topic Closed

This topic has been closed to new replies.

About this Topic