• Resolved ikthius

    (@ikthius)


    Hey everyone,

    I have got a widget (dynamic sidebar) that is from the default theme, which I added to my theme.

    I added in outside RSS, but when I click the links, I want to make another window/tab open up as it is outside RSS.

    Where would I change the link so that I can have a target=”_blank”???

    ik

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter ikthius

    (@ikthius)

    Thread Starter ikthius

    (@ikthius)

    I can see that in the functions.php file this has something to do with the code:

    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
        ));

    but I can’t seem to see where I can add in a target=”_blank” to the link that is produced…

    can someone point me in the right direction please?

    That widget code is only to “turn on” widgets. If you didn’t have it, then there wouldn’t be any widgets on your site available to you. It really doesn’t have much to do with what you actually put *inside* the sidebar – save giving it some default tags that run on *every* widget you use. The default RSS widget that comes with WP doesn’t really have the option to allow it to open in a new window, and to edit that, you’d have to get into some core code (and you don’t want to do that – not unless you know what you’re doing.)

    What you *can* do is use a text widget instead, and manually put in the link – then you can add whatever you want to it. that would be the simplest option to go with.

    Thread Starter ikthius

    (@ikthius)

    I am looking to have what is in the dynamic bar…

    the title of the fees, then the permalink to the latest feed, as it is external from sources like BBC, how can I do that?

    so that when I click on the permalink, it opens a new tab/window?

    Thread Starter ikthius

    (@ikthius)

    I eventually found what I was looking for……

    in the folder wordpress\wp-includes
    there is a file called widgets.php

    I needed to find the actual output part for the rss and found this function:
    function wp_widget_rss_output

    within that I got the echo for the HTML and added my target=’_blank’ in this section near the end of that function:

    echo "<li><a class='rsswidget' href='$link' title='$desc'
    target='_blank'>$title</a>{$date}{$summary}{$author}</li>";

    it works a treat now

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Dynamic Sidebar/Widget – adjustment’ is closed to new replies.