Does anyone know the html code for opening an article url in a new window and not actually exit my site?
How to configure it in wp dashboard?
Thanks.
Does anyone know the html code for opening an article url in a new window and not actually exit my site?
How to configure it in wp dashboard?
Thanks.
The HTML code is:
HTML Code:<a title="news" href="http://cnn.com" target="_blank">The latest News</a>
If you are talking about the "Links" part of WP, scroll down a bit when you are creating/editing the link to the section named "Target" there are three radio buttons. Click on "_blank"
If you are talking about a link that you put when you are writing a blog entry, there is an option for that if you use the WYSIWYG editor.
If you are talking about links that might be put in via comments, I do not know.
Last edited by descalzo; 05-17-2010 at 04:39 PM.
I can't find any way of doing it in a stock Wordpress install without editing every single post. I did however find this plugin that looks like what you want.
You can set the default target for all links to be _blank or _new using the <base> tag in the page head:
Note, though, that deciding for your users is considered bad form these days.Code:<base target="_blank" />
“Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
"It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)
Hi, thanks for that. However, you mentioned the base tag in page template. I have the following code:
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post">
<h2><?php the_title(); ?></h2>
<div class="entry">
<?php the_content(); ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php edit_post_link('Edit.', '<p>', '</p>'); ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Where can i embed <base target="_blank" /> into the above template?
You mentioned:
Note, though, that deciding for your users is considered bad form these days.
I understand what you are saying, but visitors will still be able to access their website without leaving mine. Besides, it is their content on my site.
Thanks.
Last edited by ata.online; 05-18-2010 at 05:11 AM.
Not sure what your trying to do here?
If you change the base tag ALL links will open in a new window, including viewing pages and posts.
If you wish to do this place the tag in the header sectin of your website, typically in wordpress look for a file named header.php in your template folder.
within the <head> and </head>
add
<base target="_blank" />
all your hyperlinks will now open in a new window, would`nt advise this though
Hi, thanks for that.
I embedded code as shown. You mentioned that you would not recommend it and i came across an article on this subject:
http://articles.sitepoint.com/articl...nks-new-window
Does anyone know how i can set a 'warning' message to users as mentioned in this article?
Also, from my personal experience, i find it very irritating when i visit a site and click a link hoping that it would open in a new window but doesn't. Hence, when i leave the previous site, i alway have to copy and paste the url in a new window and then press the back button.
It would be much easier for me to have links set to open in a window. I wish to remain on the current site due to other interesting features/resources/articles shown.
Last edited by ata.online; 05-20-2010 at 05:54 PM.
I noticed that every link opens in a new window including the anchor HOME link which is slightly strange.
Is it possible to only have article links to open in new window and not my own website links?
Or would that involve adding html code to each article, which would be rather tedious?
Last edited by ata.online; 05-20-2010 at 06:08 PM.