Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Blogs and Blogging (http://www.greenguysboard.com/board/forumdisplay.php?f=8)
-   -   target="_blank" on main index links (http://www.greenguysboard.com/board/showthread.php?t=31931)

Erick G 2006-06-02 12:15 AM

target="_blank" on main index links
 
Hey
Can someone tell if there is a way to set links and thumbs in the main index posts to target="_blank" so I dont have to do it manually on each post.

thanks

QuickDraw 2006-06-02 01:39 AM

... for a specific script? I'm not following you here...

Erick G 2006-06-02 02:25 AM

Im using wordpress and I want my mains links and thumbnails to open in a new window. I can add the code manually for each post, but would rather have it done automaticly to all my links.

ronnie 2006-06-02 05:28 AM

Think you'd have to dig into the code, edit how the script builds the links.

ronnie

tickler 2006-06-02 07:39 AM

You could use which would open all links on the page in a new window.
http://wordpress.org/support/topic/449

Erick G 2006-06-02 11:03 AM

thanks

virgohippy 2006-06-02 02:04 PM

If you do that ALL links open in new windows... even your navigation links.

If you're using WP it could be a bigger pain in the ass then to dig up the way it handles the content.

Maybe you could write a quick little script which writes all the code for you, and all you do is input the thumb url, the link url, and whetever, then take the output and pop it into your entry. |thumb

walrus 2006-06-02 02:44 PM

Quote:

Originally Posted by Erick G
Hey
Can someone tell if there is a way to set links and thumbs in the main index posts to target="_blank" so I dont have to do it manually on each post.

thanks

If I understand you want the links in your posts to open in a new window and not all your links to do that.

You could edit "The Loop" which starts here
Code:


adding after that line. Then before the end of the loop, which looks something like this
Code:




you could set the base target back to self.

At least in theory, I think this should work but you may have to play with the exact location of the base target self code so that if you allow comments they don't open in a new window.

If your talking about links in a sidebar, there is a button on the bottom of the add link page that will allow you to set the link for blank

Erick G 2006-06-14 12:06 PM

thanks walrus i think this will work.

oast 2006-06-17 06:05 PM

Are you writing the posts, adding links and then having to manually add the target="_blank"?

If so:
In your 'wp-includes/js' directory is a file called "quicktags.js"

On line 371 is the code that handles the 'link' quicktag.
Code:

edButtons[i].tagStart = '';
My altered code:
Replace the rel="external" with target="_blank" (I use the 'rel' tag with some js, because 'target' is not a valid xhtml tag.)

If not:
How are you getting the posts on your blog? There will be a way to alter the post automagically :)

http://adultweblogger.com


All times are GMT -4. The time now is 06:03 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc