Jump to content
daveschroeder

Feature Links Opening in New Window

Recommended Posts

daveschroeder    0
daveschroeder

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
James B    436
James B

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?


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
daveschroeder    0
daveschroeder

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
daveschroeder    0
daveschroeder

And it's not showing any errors...

Share this post


Link to post
Share on other sites
James B    436
James B

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


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
James B    436
James B

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


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
daveschroeder    0
daveschroeder

Thanks!

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi,

 

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


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
daveschroeder    0
daveschroeder

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
Danny    1,327
Danny

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"'; } );

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
daveschroeder    0
daveschroeder

Thanks! I will give that a try!

Share this post


Link to post
Share on other sites
daveschroeder    0
daveschroeder

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
Danny    1,327
Danny

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

 

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


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
daveschroeder    0
daveschroeder

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
daveschroeder    0
daveschroeder

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
catrina    103
catrina

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?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
Simon    247
Simon

What php version?

Share this post


Link to post
Share on other sites
daveschroeder    0
daveschroeder

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

PHP Version 5.2.17

Share this post


Link to post
Share on other sites
daveschroeder    0
daveschroeder

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
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
daveschroeder    0
daveschroeder

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
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×