Archived

This topic is now archived and is closed to further replies.

  • 0

Feature Links Opening in New Window


Question

Posted · Report post

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 http://centraladvocacy.com.

 

Many thanks -- Dave

 

 

functions.php

Share this post


Link to post
Share on other sites

27 answers to this question

Posted · Report post

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!

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Simon --

 

I copied the line above into the end of the pagelines-customize functions.php file for a test site, http://daveschroederconsulting.com. I set the links for the default PageLines Features slides to google.com.

 

I'm not getting any error messages, though.

 

You can check it out -- they're still opening "_self" instead of opening new windows.

 

Sorry for the hassle -- thanks -- Dave

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Dave,

 

No need to apologise, can you do us a favour and enable PageLines debug mode please and also take a screenshot of your PageLines Customize plugins functions.php please, so we can see the code.

 

Enable PageLines debug: PageLines > Site Options > Advanced.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Danny --

 

No worries!  I have to leave to visit a client now -- the one who needs this functionality -- but can check the status via email. 

 

Much obliged -- Dave

 

functionsDOTphp%20screen%20shot.jpg

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Dave,

 

The code in your customisation plugin functions.php file looks fine as far as I can see. However, you didn't enable PageLines debug mode.

Share this post


Link to post
Share on other sites

Posted · Report post

I must not have hit Save. 

 

I have to get on the road now, but please see if that does it.

 

Much obliged -- Dave

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks that did the trick.


When viewing your debug information you have the following, which may be causing the issue.

 

PHP User : Posix functions are disabled on this host!

PHP Magic Quotes gpc : Yes (bad)

I recommend you contact your host and ask them to resolve this.

Posix by default is enabled in PHP, your host has disabled it for some reason.

Share this post


Link to post
Share on other sites

Posted · Report post

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?

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

And it's not showing any errors...

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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 :-)

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks!

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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.

 

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

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks! I will give that a try!

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

 

http://cl.ly/image/3z2S3o090Y41

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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?

Share this post


Link to post
Share on other sites