Tagged: featured content, front page, polylang, translation
- This topic has 36 replies, 4 voices, and was last updated 8 years ago by Sakin.
-
AuthorPosts
-
May 22, 2015 at 9:29 pm #58151widespreadMember
Hi Catch Themes and everyone.
I’m using the Polylang plugin to make a double language WordPress website together with your nice Catch-Base Theme. So far no problems at all.
The only thing that I don’t know how to make happen is letting Polylang translate the Featured Content Title and Description on the homepage.
All the other strings instead (like website title, description, search bar text, …), are seen by Polylang, and are shown in a table in the plugin settings where I can easily translate them into other languages.
Could you update the theme so that those strings I mentioned could be translated too? Or could you advice a quick fix meanwhile, if you don’t plan that it will happen soon?
Thanks a lot guys!
I’m gonna keep recommending this theme of course! 🙂May 23, 2015 at 10:13 pm #58203SakinKeymaster@widespread: For this you need to add xml file
wpml-config.xml
incatch-base
theme directory.<wpml-config> <admin-texts> <key name="catchbase_options"> <key name="featured_content_headline"/> <key name="featured_content_subheadline"/> </key> </admin-texts> </wpml-config>
Then add the following code in your theme functions.php file
/** * Template for Clearing WPML Invalid Cache * * To override this in a child theme * simply create your own catchbase_wpml_invalidcache(), and that function will be used instead. * * @since Catch Base */ function catchbase_wpml_invalidcache() { delete_transient( 'catchbase_featured_content' ); } // catchbase_wpml_invalidcache endif; add_action( 'after_setup_theme', 'catchbase_wpml_invalidcache' );
Note: We need to work on this to make our theme Polylang plugin ready. It’s getting late as we are suffering from earthquake and after shocks in Nepal. So, it will be delayed for now.
May 27, 2015 at 11:27 am #58398widespreadMemberThanks! And I really hope things will slowly get better there. My heart is with you guys.
About the code you provided, after making the changes I get this:
Warning: array() expects parameter 1 to be a valid callback, function ‘catchbase_featured_content’ not found or invalid function name in /home/my_website/public_html/wp-includes/plugin.php on line 496
I’m using a child theme for catch base so I put both the xml and the functions.php code in the child theme folder and child theme functions.php, is that ok?
Also I deleted that “endif” after the function.
Thanks again.
May 27, 2015 at 4:38 pm #58413SakinKeymaster@widespread: Sorry, I have edited the code above. Now you can try new one, where I replaced
add_action( 'after_setup_theme', 'catchbase_featured_content' );
with
add_action( 'after_setup_theme', 'catchbase_wpml_invalidcache' );
May 27, 2015 at 10:23 pm #58442widespreadMemberThanks, I tried changing the code, no errors now, but in Polylang settings I can’t see the text fields for translating Featured Content Title and Description.
What am I missing? Again, I’ve saved the wpml-config.xml in catch-base-child-theme folder, and edited functions.php in catch-base-child-theme folder and also removed that “endif;” from your code.
Is this all correct?What else could it be that I am missing?
May 28, 2015 at 9:53 am #58476SakinKeymaster@widespread: Not sure, you might need to ask plugin support. Can you go to “Settings => Languages => string translations”
May 29, 2015 at 3:08 am #58530widespreadMember@Sakin: yes that’s the settings I’m talking about: in that page I can’t see “featured content title” and “featured content description” strings fields.
I saved this in public_html/wp-content/themes/catch-base-child/wpml-config.xml
<wpml-config> <admin-texts> <key name="catchbase_options"> <key name="featured_content_headline"/> <key name="featured_content_subheadline"/> </key> </admin-texts> </wpml-config>
and this in public_html/wp-content/themes/catch-base-child/functions.php
function catchbase_wpml_invalidcache() { delete_transient( 'catchbase_featured_content' ); } // catchbase_wpml_invalidcache /* endif; */ add_action( 'after_setup_theme', 'catchbase_wpml_invalidcache' );
before the last ?> PHP closing tag.
At what stage is “after_setup_theme” being triggered though? Maybe it’s not ?
I’ll also try to post in Polylang forum, but being the setup of additional content to be translated that easy, I think there must be some step that we’re missing?If you got something else let me know please, I’ll get back with news from Polylang too.
Cheers and thanks 🙂
May 29, 2015 at 11:00 am #58546SakinKeymaster@widespread: try adding xml file in your parent theme in
public_html/wp-content/themes/catch-base/wpml-config.xml
. I am not sure how Polylang works. Here is complete list of XML file https://gist.github.com/sakinshrestha/6cc4ba393ade041c16ae#file-wpml-config-xmlJune 1, 2015 at 3:54 pm #58716widespreadMembertry adding xml file in your parent theme
tried that, did not work..
Here is complete list of XML file https://gist.github.com/sakinshrestha/6cc4ba393ade041c16ae#file-wpml-config-xml
Ok, but isn’t it a description of text strings for the admin interface only, anyway?
I understand you’re not familiar with Polylang, but then what was the reason for for creating that .xml file in the theme folder (or child-theme folder) ?
ThanksJune 1, 2015 at 7:39 pm #58731SakinKeymaster@widespread: That XML is for string translation. See this https://polylang.wordpress.com/documentation/setting-up-a-wordpress-multilingual-site-with-polylang/strings-translation/
Please post in your site URL as well. Also did you ask in that Polylang support forum.
June 1, 2015 at 11:20 pm #58742widespreadMemberHey @Sakin, you only had missed the theme name key, it should have been like this:
<wpml-config> <admin-texts> <key name="theme_mods_catch-base-child"> <key name="catchbase_theme_options"> <key name="featured_content_headline" /> <key name="featured_content_subheadline" /> </key> </key> </admin-texts> </wpml-config>
Now it works! Thanks for your support!
Where can I donate you a beer?
Cheers.June 2, 2015 at 4:03 am #58749SakinKeymaster@widespread: Thanks for the update. Sorry, I missed it. Here is donation link http://catchthemes.com/donate/
June 10, 2015 at 4:59 pm #59276PiusParticipantHi,
I am a novice to all this building my first webpage, so please apologize my ignorance.I have the same problem initially explained in this thread. Now I read trough all this and I am a little confused about the final solution.
Can you please give me step by step instruction on how to implement the xml file with it’s code that finally worked.
Also should I create a child theme?
I am using the latest version of wordpress as well as the latest version of polylang.
Thanks a lot
June 10, 2015 at 5:04 pm #59277PiusParticipantoh sorry and I am using the Full Frame Pro theme
June 12, 2015 at 11:06 am #59392SakinKeymaster@Pius: Please wait for some time, we are in the process of making Full Frame Pro theme. we will be to release it within next week.
June 12, 2015 at 11:36 am #59395PiusParticipantThanks Sakin that’s good news.
Can’t wait to update and get my new webpage online.June 21, 2015 at 5:24 pm #59882PiusParticipantHi Sakin,
can you give me a rough estimate when the update will be available?Thanks a bunch.
June 24, 2015 at 2:29 am #60020SakinKeymaster@Pius: Sorry for the delay. It will be by this weekend. We are doing final testing.
June 26, 2015 at 2:57 am #60150PiusParticipantFantastic work Sakin 🙂
I have a small problem though. I installed Full Frame Pro version 3 on my local machine in my test environment. Everything worked beautifully. I had all the string translation categories available and even the spacing between the logo and the header right is fixed.After testing I uploaded V3 via FTP. Then I went to check the strip translation tab. I only had like 3 lines in there, versus the like 20 or so which I had in my test environment. My local test version is practically identical to my online version. Both using a child theme.
Not sure what to do?
Thanks a lot for you great work so far.
June 26, 2015 at 9:25 am #60152SakinKeymaster@Pius: String translation will show the items that you have entered. It will not show the demo. So, make sure you add in the text first from “Appearance => Customize” and then only check string translation.
-
AuthorPosts
- The topic ‘Polylang: translating Featured Content title and description’ is closed to new replies.