#1
Posted 10 October 2012 - 11:33 AM
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
#2
Posted 10 October 2012 - 01:47 PM
function add_lang_features($metadata, $object_id, $meta_key, $single){
if ( function_exists( 'qtrans_getLanguage' ) && isset($meta_key) && 'feature-link-url' === $meta_key) {
return sprintf( '%s?lang=%s', $metadata, qtrans_getLanguage() );
}
return $metadata;
}
add_filter('get_post_metadata', 'add_lang_features', true, 4);
#3
Posted 10 October 2012 - 02:07 PM
From the editor in appearance, I selected the platformbase theme to edit. I opened function.php and on the bottom i pasted what you sent. But nothing happened.
did i do something wrong?
#4
Posted 10 October 2012 - 02:10 PM
#5
Posted 10 October 2012 - 02:22 PM
any ideas?
#6
Posted 10 October 2012 - 02:23 PM
You probably dont have the platformbase theme activated
Go to Appearance/themes and activate the child theme.
#7
Posted 10 October 2012 - 02:38 PM
everything that is deactivated with platformbase theme is reconfigured when i reactivate the platformpro.
#8
Posted 10 October 2012 - 02:40 PM
Its up to you if you want to use it, i tested the code, it works 100%
#9
Posted 10 October 2012 - 03:05 PM
i included the code in pagelinesbase/functions via FTP, I activated pagelinesbase theme is appearance, i double checked all of the above...
#10
Posted 10 October 2012 - 03:36 PM
#11
Posted 10 October 2012 - 03:50 PM
revised code.
function add_lang_features($metadata, $object_id, $meta_key, $single){if ( ! is_admin() && function_exists( 'qtrans_getLanguage' ) && isset($meta_key) && 'feature-link-url' === $meta_key) { remove_filter( 'get_post_metadata', 'add_lang_features', 999, 4 ); $data = get_post_meta( $object_id, 'feature-link-url' ); $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);
#12
Posted 10 October 2012 - 04:07 PM
Thanks for your patience and insistance
#13
Posted 10 October 2012 - 04:08 PM
#14
Posted 10 October 2012 - 04:25 PM
#15
Posted 10 October 2012 - 04:27 PM
#16
Posted 10 October 2012 - 04:38 PM
#17
Posted 10 October 2012 - 04:39 PM
#18
Posted 10 October 2012 - 04:39 PM
Its small alright, where is it? lolOK. It's very small, so let me know if you can see all of it.
#19
Posted 10 October 2012 - 04:43 PM

and
#20
Posted 10 October 2012 - 04:44 PM
Also tagged with one or more of these keywords: Resolved
Resolved
PageLines Framework →
Technical Support →
Anything Boxes And Polylang Language Filtering ProblemStarted by janpeeters , 01 Dec 2012 |
|
|
||
Header In Banner AlignmentStarted by bankrollbuilder , 28 Nov 2012 |
|
|
||
Resolved
PageLines Framework →
Customizations →
2 Hero UnitsStarted by starlit , 28 Nov 2012 |
|
|
||
Tabs Do Not Align HorizontallyStarted by hutruk , 28 Nov 2012 |
|
|
||
Resolved
PageLines Framework →
Customizations →
Reduce Margin In Contact FormStarted by texasx , 27 Nov 2012 |
|
|












