Jump to content
Sign in to follow this  
dil_bert

Running PolyLang in a special Use-Case: a page-only setting

Recommended Posts

 hello dear experts,  

 

Running PolyLang in a special Use-Case: a page-only setting 

the topic of the day: How to run PolyLang the wordpress-translation for a special use case - my use-case: i only want to have PolyLand in the pages:

The use case: in my use case: Pages describe the project. Therfore the pages are important to me. 


I’m using polylang for translating pages  - and i am very happy with it.  Posts, i do not want to translate.
on my page - the Posts should stay be single language - englisch.

the question is: is this behaviour doable - can i configure wordpress and polylang so that.
What is aimed: the sytem should show when I publish posts without translating. is this doable!?

question: do i still need a post in each language. Is this necessary?

solution 1: so in the case of the posts: the solution can be to copy the post 1:1 to all reffered languages, 
so in fact Polylang gets the post (with different ID) in all the requested languages but with the same content.

or even better: the solution 2 So no way to ignore translating posts.

“ignore translating posts”? How do you expect Polylang should ignore posts?

this is my use case 

Quote

 

* Offering to visitors the interface in different languages - therefore a language switcher is important.
* Pages describe the project and it is good to have all of them translated.
* Posts do not need to be translated in any of these languages, but we don’t want the separation by languages. 
We don’t have the capacity to translate everything. Most readers will understand english langauage at some degree anyway. 
We want them to read all the posts in english.

 

 

 

what may help me - we can turn off translations for posts with a hook:

 

function turn_blogposts_translation_off( $post_types, $is_settings ) {
  unset( $post_types['post'] );
  
  return $post_types;
}

add_filter( 'pll_get_post_types', 'turn_blogposts_translation_off', 


furthermore we can with Polylang deactivate the translations for the Categories and Tags of Post.

 

Turn Off Translations for Category

function turn_categoryblog_translation_off( $taxonomies, $is_settings ) {
    unset( $taxonomies['category'] );
    return $taxonomies;
}
add_filter( 'pll_get_taxonomies', 'turn_categoryblog_translation_off', 10, 2 );
Turn Off translations for tag

 

and the turn-off of even more... see here: 

 

function turn_tagblog_translation_off( $taxonomies, $is_settings ) {
    unset( $taxonomies['post_tag'] );
    return $taxonomies;
}
add_filter( 'pll_get_taxonomies', 'turn_tagblog_translation_of

 

well - i will try out the code to get the aimed goals done and do achieve all the things i need to achive on the site.

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.