WordPress.org

Ready to get started?Download WordPress

Forums

How can i make all internal links open in same window and external links in new (2 posts)

  1. mouryan3108
    Member
    Posted 1 year ago #

    I am using wordpress 3.4.2
    When used following code

    [ Moderator note: please put the backtick on a line above and below your code example, it doesn't format correctly otherwise. ]

    <a> " target="_self">Test</a>
    	<a href="http://www.google.co.in/">Google with http and no other attributes</a>
    	<a href="http://www.google.co.in/">Google with http and target=_self</a>
    	<a href="google.com">Google without http</a>

    It is generating folowing HTML code

    <div id="links">
            <a href="http://myworks.eka/projects/local-dev/welthungerhilfe/?p=188">This internal link</a>
            <a href="http://www.google.co.in/">Google with http and no other attributes</a>
            <a href="http://www.google.co.in/">Google with http and target=_self</a>
            <a href="google.com">Google without http</a>
            </div>

    How can i make all internal links open in same window and external links in new tab or window?

  2. Where are you inputting that HTML? Via the post editor?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.