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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-08-2013, 03:12 AM   #1
rogueteens
So fucking bland
 
rogueteens's Avatar
 
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
Wordpresss modification question

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!!
rogueteens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 05:01 AM   #2
purecane
Annakin Skywalker
 
purecane's Avatar
 
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]
purecane is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 05:10 AM   #3
rogueteens
So fucking bland
 
rogueteens's Avatar
 
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
Quote:
Originally Posted by purecane73 View Post
on mine when you add the custom url, it has a box to check for either new window or same page....
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!!
rogueteens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 05:26 AM   #4
purecane
Annakin Skywalker
 
purecane's Avatar
 
Industry Role:
Join Date: Jan 2013
Location: megaminds' secret lair
Posts: 1,324
yep, you're right...i see now.
__________________
[email protected]
purecane is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 07:02 AM   #5
TrashyGirl
Confirmed User
 
TrashyGirl's Avatar
 
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 ???
TrashyGirl is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 08:32 AM   #6
Fetish Gimp
Confirmed User
 
Industry Role:
Join Date: Feb 2005
Posts: 1,699
Quote:
Originally Posted by rogueteens View Post
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
Haven't tried this myself, but looks like it might do what you want
http://wordpress.org/extend/plugins/...-custom-links/
__________________
Strapon Seduction - femdom blog | Twitter
Fetish Gimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 11:08 AM   #7
rogueteens
So fucking bland
 
rogueteens's Avatar
 
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!!
rogueteens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 01:57 PM   #8
iwantchixx
Too lazy to set a custom title
 
iwantchixx's Avatar
 
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?
iwantchixx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 02:00 PM   #9
harvey
Confirmed User
 
harvey's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
Quote:
Originally Posted by iwantchixx View Post
Do you want all pics to act like this, if so why not just use a lightbox?
this

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
harvey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 02:18 PM   #10
rogueteens
So fucking bland
 
rogueteens's Avatar
 
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
Quote:
Originally Posted by iwantchixx View Post
Do you want all pics to act like this, if so why not just use a lightbox?
It doesn't work with the theme i'm using. it shows the pictures full size and I have them clickable to go to sponsors and I want the click to open in a new window.

Quote:
Originally Posted by harvey View Post
that seems like a heck of a lot of mucking around just to get the image opening in a new window, I think it might muck up other stuff I have on my blog too but thanks anyway.
__________________
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!!
rogueteens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 02:32 PM   #11
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
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 ) );
}
?>
__________________
Join the BEST cam affiliate program on the internet!
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..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 02:37 PM   #12
duk75
Confirmed User
 
Industry Role:
Join Date: Feb 2012
Posts: 741
TARGET="_blank"
__________________
...Nice.
duk75 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-08-2013, 03:04 PM   #13
rogueteens
So fucking bland
 
rogueteens's Avatar
 
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
Quote:
Originally Posted by Colmike7 View Post
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 ) );
}
?>
thank you very much
__________________
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!!
rogueteens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-10-2013, 11:26 AM   #14
fris
Too lazy to set a custom title
 
fris's Avatar
 
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;
}
not sure if thats what you want.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.