Jump to content


Photo
* * * * * 1 votes

Feature Links Opening in New Window

Features Customize

Best Answer daveschroeder , 08 March 2013 - 05:52 PM

Just got back... It turns out that GoDaddy.com says they don't install Posix for "security reasons" and that if I want it from them I'll have to get a dedicated server.

Next year, I'll move to another hosting provider! Go to the full post


  • Please log in to reply
27 replies to this topic

#1 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 06 March 2013 - 11:41 PM

Hi folks --

 

I just installed Pagelines last week on GoDaddy using WP 3.5.1.

 

 

I added the Customize plugin and Activated it and then added the following line at the end of the Customize functions.php file.

 

add_filter( 'pagelines_features_target', function() { return 'target="_blank"'; } );

 

I'm new at this so I'm probably missing something because my Features links are not opening in new pages or tabs now.

 

Any idea what I'm doing wrong?

 

The links are on the first and third images on the home page at

Please Login or Register to see this Hidden Content

 

Many thanks -- Dave

 

 

Attached Files



#2 James B

James B

    Advocate

  • Moderators
  • 4979 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 07 March 2013 - 12:47 AM

I'm not strong enough on php to advise on the above and tell you if its correct unfortunately.

 

However, are you getting an error thrown when you enter this? Anything that's suggesting where the code is incorrect?

 

Where did you find the filter above?



#3 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 12:51 AM

I am not a PHP person either. I found this code on a forum thread on opening Feature link URLs in new windows.

#4 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 01:05 AM

And it's not showing any errors...

#5 James B

James B

    Advocate

  • Moderators
  • 4979 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 07 March 2013 - 01:18 AM

If you can post a link to the original thread I'll see if we can track down the original poster for you. Usually that type of filter would be outside of our support spectrum, but if it's one of our team I might be able to track them down and find out more for you



#6 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 01:20 AM

Here's where I found it:

Please Login or Register to see this Hidden Content



#7 James B

James B

    Advocate

  • Moderators
  • 4979 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 07 March 2013 - 01:56 AM

Excellent, Simon's one of our developers. I'll send him a message to see if that's the correct code still and we'll update you when we get a response :-)



#8 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 01:56 AM

Thanks!

#9 Danny

Danny

    Is Awesome!

  • Moderators
  • 13021 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 07 March 2013 - 06:43 AM

Hi,

 

Please review the code in the topic again, as I have just fixed it. Basically, that code wasn't correctly formatted.



#10 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 06:49 AM

Hi Danny --

 

My apologies, but I just just checked on the referenced post with Simon's snippet and there haven't been any updates there. Do you mean my code snipped was not correctly formatted or some code at your end wasn't and you've just fixed it.

 

Thanks so much -- Dave



#11 Danny

Danny

    Is Awesome!

  • Moderators
  • 13021 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 07 March 2013 - 07:23 AM

Basically, the code Simon wrote works as I tried this myself just a moment ago. However, the forums had not added the code in the correct format and replace '' with ASCII Code. I have corrected this below.

 

Please Login or Register to see this Hidden Content



#12 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 08:12 AM

Thanks! I will give that a try!

#13 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 12:47 PM

I checked and that's the exact character for character syntax of what I added to the end of the functions.php file in the customize plugin originally.

 

 

/*
// ====================================================
// = YOUR FUNCTIONS - Where you should add your code  =
// ====================================================
*/
 
add_filter( 'pagelines_features_target', function() { return 'target="_blank"'; } );
 
Do I have to do something else to make it work? The customize plugin is activated.
 
Thanks -- Dave


#14 Danny

Danny

    Is Awesome!

  • Moderators
  • 13021 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 07 March 2013 - 01:00 PM

Well the code does indeed work. Have you made sure you have added a link to your feature(s) ?

 

Please Login or Register to see this Hidden Content



#15 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 01:19 PM

Yes... here's the relevant image from one of the three feature slides:

 

FeatureURL.jpg

 

I've double-checked and Pagelines Customize is activated.

 

That should be all I need to do, right?

 

Thanks -- Dave



#16 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 03:25 PM

As I've been testing when I add the filter below to my Customize functions.php file I get the following error that takes down my site:

 

/*

// ====================================================
// = YOUR FUNCTIONS - Where you should add your code  =
// ====================================================
*/
 
add_filter( 'pagelines_features_target', function() { return 'target="_blank"'; } );


Parse error: syntax error, unexpected T_FUNCTION in /home/content/14/10661214/html/wp-content/plugins/pagelines-customize/functions.php on line 46



#17 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 07 March 2013 - 04:43 PM

Can you please paste the entire code in your functions.php file in a pastebin at www.pastebin.com and post the link to it here?



#18 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 07 March 2013 - 05:21 PM

Thanks, Catrina.

 

Here's the link.

 

Please Login or Register to see this Hidden Content



#19 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 07 March 2013 - 11:52 PM

What php version?



#20 daveschroeder

daveschroeder

    Member

  • Members
  • 16 posts
  • LocationGrayson, GA
  • Framework Version:Latest
  • Country: Country Flag

Posted 08 March 2013 - 12:00 AM

Hi Simon -- I checked and it's PHP  Version 5.2.17. Thanks for your help! 

PHP Version 5.2.17