Tagged: featured slider, polylang, Promotion Headline, translation
- This topic has 7 replies, 2 voices, and was last updated 8 years ago by Mahesh.
-
AuthorPosts
-
December 8, 2016 at 12:40 am #104818chrisDugParticipant
I have my site setup using Polylang to translate my site from English to French however when i click the French button the Featured slider and promotional Headline does not translate. Ive noticed that when I change the Language while inside of WP-customizer the slider translates but once I save and exit it locks onto the language that was active when i exit customizer. any help with this would be much appreciated im using wordpress 4.7 and the most recent version of Polylang translator. my site is http://michellevesquelifeinsurance.ca/
Thanks!!
December 8, 2016 at 10:29 am #104884MaheshParticipant@chirsdug: For this, you’ll need to create a child theme. You can find more details on creating child theme HERE. Then in your child theme’s
functions.php
, add the following codes:if ( ! function_exists( 'catchresponsive_child_polylang_invalidcache' ) ) : /** * Template for Clearing Polylang Invalid Cache * */ function catchresponsive_child_polylang_invalidcache() { delete_transient( 'catchresponsive_promotion_headline' ); delete_transient( 'catchresponsive_featured_content' ); delete_transient( 'catchresponsive_featured_slider' ); } // catchresponsive_child_polylang_invalidcache endif; add_action( 'after_setup_theme', 'catchresponsive_child_polylang_invalidcache' );
This function is for Promotion Headline for custom language, with give you option to put the desired text for the translation.
function catchresponsive_child_polylang() { if ( function_exists( 'pll_register_string' ) ) { $options = catchresponsive_get_theme_options(); $promotion_headline = $options['promotion_headline']; $promotion_subheadline = $options['promotion_subheadline']; $promotion_headline_button = $options['promotion_headline_button']; $headline = $options ['featured_content_headline']; $subheadline = $options ['featured_content_subheadline']; pll_register_string( 'featured_content_headline', $headline ); pll_register_string( 'featured_content_subheadline', $subheadline ); pll_register_string( 'promotion_headline', $promotion_headline ); pll_register_string( 'promotion_subheadline', $promotion_subheadline ); pll_register_string( 'promotion_headline_button', $promotion_headline_button ); } } add_action ( 'admin_init', 'catchresponsive_child_polylang' );
Regards,
MaheshDecember 8, 2016 at 8:05 pm #104926chrisDugParticipantHi Mahesh
Thank you very much for your reply i was able to fix the slider issue however the promotion headline still does not translate or give me an option to add the translation in customizer. I noticed also that the title for featured content does not translate either. Thank you in advance for the help it is much apreciated!!
Thanks
ChrisDecember 9, 2016 at 10:52 am #104984MaheshParticipant@chrisdug: It won’t add the translation option in the Customizer but gives you option to add translation within the plugin. Go to Dashboard=> Appearance=> Settings=> Languages and select String Translation tab. You can add the translation for Promotion Headline here.
Note: Added the translation options for Featured Content Headline and Sub Headline in the above code.Regards,
MaheshDecember 9, 2016 at 11:51 am #104988chrisDugParticipantThank you soo much @Mahesh for the quick reply i added the stings into the settings but when i go on the site it is still not translating.
Thanks!!
ChrisDecember 9, 2016 at 2:05 pm #105000MaheshParticipant@chirsdug: Thank you for your appreciation. Have a nice day!
Regards,
MaheshDecember 12, 2016 at 8:07 pm #105227chrisDugParticipantHi @Mahesh
I added the Featured headline and promotion headline strings into the settings but when i go on the site it is still not translating. Any Help you can provide is very much appreciated.
Thank you!
ChrisDecember 13, 2016 at 11:07 am #105270MaheshParticipant@chirsdug: Please contact the plugin support for the issue. This is the most we can do from the theme point of view.
Hope you understand.Regards,
Mahesh -
AuthorPosts
- The topic ‘How do I get the Featured slider, promotion headline to Translate with polylang’ is closed to new replies.