![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
So fucking bland
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
|
![]() When I add media I have the option to link the attachment to a variety of options (custom url, media file, that type of thing) but where in the WP back end can I find the code that controls this? I want to make it so that clicking on the image opens in a new window.
Cheers
__________________
Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES! ![]() Easily my best performing webcam sponsor - CLICK HERE!! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Annakin Skywalker
Industry Role:
Join Date: Jan 2013
Location: megaminds' secret lair
Posts: 1,324
|
on mine when you add the custom url, it has a box to check for either new window or same page....
__________________
[email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
So fucking bland
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
|
I don't think you do from the "Insert Media" > "Upload Files" > "Attachment Display Settings" page, which is what I want to modify.
__________________
Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES! ![]() Easily my best performing webcam sponsor - CLICK HERE!! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Annakin Skywalker
Industry Role:
Join Date: Jan 2013
Location: megaminds' secret lair
Posts: 1,324
|
yep, you're right...i see now.
__________________
[email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Apr 2010
Posts: 1,401
|
You used to be able to do this by clicking on the image in "Edit Media" and then clicking on the "Advanced Settings" and clicking a box for Target - Open in a New Window. But I don't see this feature w/ the new WP update that changed image handling. I think it can be done for galleries using NextGen Gallery plugin.
The coding issue would be that the images set in each post are specific content to each post as far as how I understand WP. So maybe Fris or someone else can advise you the code to insert to loop thru the posts, use regex to grab the images and code them to open t\ blank ??? ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: Feb 2005
Posts: 1,699
|
Quote:
http://wordpress.org/extend/plugins/...-custom-links/ |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
So fucking bland
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
|
I don't think that'll work.
I really did think it would just be a simple line modification in one of the files?
__________________
Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES! ![]() Easily my best performing webcam sponsor - CLICK HERE!! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Too lazy to set a custom title
Industry Role:
Join Date: Oct 2002
Location: The Boonies
Posts: 12,860
|
Do you want all pics to act like this, if so why not just use a lightbox?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
|
Quote:
anyway, you could also use http://wordpress.org/extend/plugins/...window-plugin/
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | ||
So fucking bland
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
|
Quote:
Quote:
__________________
Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES! ![]() Easily my best performing webcam sponsor - CLICK HERE!! |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
(>^_^)b
Industry Role:
Join Date: Dec 2011
Posts: 7,224
|
Code:
<?php /* Plugin Name: (#50911) Open gallery img in new window/tab */ add_action( 'after_setup_theme', 'wpse50911_replace_img_shortcodes' ); function wpse50911_replace_img_shortcodes() { remove_shortcode( 'gallery', 'gallery_shortcode' ); add_shortcode( 'gallery', 'wpse50911_gallery_shortcode' ); remove_shortcode( 'caption', 'img_caption_shortcode' ); add_shortcode( 'caption', 'wpse50911_caption_shortcode' ); remove_shortcode( 'wp_caption', 'img_caption_shortcode' ); add_shortcode( 'wp_caption', 'wpse50911_caption_shortcode' ); } function wpse50911_gallery_shortcode( $attr ) { return links_add_target( gallery_shortcode( $attr ) ); } function wpse50911_caption_shortcode( $attr, $content = null) { return img_caption_shortcode( $attr, links_add_target( $content ) ); } ?>
__________________
![]() I've referred over $1.7mil in spending this past year, you should join in. ![]() ![]() I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years.. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Feb 2012
Posts: 741
|
TARGET="_blank"
__________________
...Nice. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
So fucking bland
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
|
Quote:
![]()
__________________
Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES! ![]() Easily my best performing webcam sponsor - CLICK HERE!! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,248
|
you can make it default to the url of the image
Code:
add_filter( 'attachment_link', 'direct_image_urls_for_galleries', 10, 2 ); function direct_image_urls_for_galleries( $link, $id ) { if ( is_admin() ) return $link; $mimetypes = array( 'image/jpeg', 'image/png', 'image/gif' ); $post = get_post( $id ); if ( in_array( $post->post_mime_type, $mimetypes ) ) return wp_get_attachment_url( $id ); else return $link; }
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |