• 0

Resolved Using URL in boxes and feature with Qtranslate

Question

Posted · Report post

Hi
I’m using PagelinePro theme for a page i'm building: www.americasblindspot.com .
it's a bilingual site, spanish and english, using the Qtranslate
plugin, that works great for titles and texts, but I don't know how to add code so that the the URLs I add in the boxes and features redirects to the appropriate language page.
Example: I switch my page to Spanish, and all the text is indeed translated correctly. But when I clik on a feature or box link, it redirects back to the English version of that page.
Can i included anything in the field “Feature Link URL: Adding a URL here will add a link to your feature slide-Enter Feature Link URL” so that it will send me to the Spanish version?
Thanks in advance

Share this post


Link to post
Share on other sites

34 answers to this question

  • 0

Posted · Report post

Then could I replace the word feature for box in your code and put it in the right place?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

well no, my shortcut didn't work at all. I tried putting in the code in the platformpro/sections/boxes.php and naturally it didn't work. nothing happened, I'm assuming because the code is written for 'functions' in the feature code.
I don't know how to write a code nor am I sure where I would put it.
Please help

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Dear PagelinePro forum: as you've probably noticed by now, because I've alerted you to do this, there are two similar posts addressing this same issue described above. I'm not quite sure how to proceed if the moderators and PagelinesPro people do not offer a solution. The PagelinesPro team simply decided not to offer further support. If I'm not going to get a response, would you be so kind as to advice me where I should turn to get support for the purchased PagelinePro product?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Sorry the Pros could not help you out, I did not receive any questions about it from them.

Ive updated the filter, no time to test

[CODE]
function add_lang_features($metadata, $object_id, $meta_key, $single){
$key = $meta_key;

if ( 'feature-link-url' != $key && 'the_box_icon_link' != $key )
return $metadata;

if ( ! is_admin() && function_exists( 'qtrans_getLanguage' ) ) {
remove_filter( 'get_post_metadata', 'add_lang_features', 999, 4 );
$data = get_post_meta( $object_id, $key );
$link = sprintf( '%s/?lang=%s', $data[0], qtrans_getLanguage() );
add_filter('get_post_metadata', 'add_lang_features', 999, 4);
return $link;
}
return $metadata;
}
add_filter('get_post_metadata', 'add_lang_features', 999, 4);
[/CODE]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for coming back simon. I inserted into functions in platformbase, but it crashed my site. This is the message i got:

[b]Fatal error[/b]: Cannot redeclare add_lang_features() (previously declared in /home/andres11/public_html/americasblindspot.com/wp-content/themes/platformbase/functions.php:103) in [b]/home/andres11/public_html/americasblindspot.com/wp-content/themes/platformbase/functions.php[/b] on line [b]133[/b]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I'm sorry Simon. My mistake. I just added the code, instead of replacing the previous one, which is what I had to do. I've tested it and it works perfectly. Problem resolved!!!

thanks so much!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi,

 

I tried your code but it doesn't seem to be doing something, I guess I didn't put it in the right place...

 

I am using a child theme (This child theme requires its parent theme, PageLines Framework.)

 

I also opened an other thread on http://forum.pagelines.com/topic/28435-qtranslate-and-pageline-features-boxes-link-issue/ since this issue was closed. 

 

could you give me a hand? thank you

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Yoni, this topic is marked resolved.  Please don't post replies on resolved topics.  They won't be answered.

Share this post


Link to post
Share on other sites
This topic is now closed to further replies.