• Is there a built-in way to filter posts by language? I am trying to add a second language to a site, but with CCS I don’t know how to select posts by language.

    I know that WordPress has two functions for detecting language:

    get_locale() returns the WordPress locale in the format 'en_US'
    get_bloginfo('language') returns the locale in the format 'en-US'

    Is there a way to access these from a loop? Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • With Polylang you can use the taxonomy “language” to get the current language – See content section in dashboard.

    And you do not have to select post by language – Polylang gives you only posts in the current language back.

    • This reply was modified 2 years, 9 months ago by polarracing.
    Thread Starter philipt18

    (@philipt18)

    Thank you. I’m not clear how to do this. If I use the taxonomy shortcode it says it will show me the taxonomy, but it doesn’t display anything. Can you share an example on how to use languages in CCS?

    I’m also having problems with editing anything as one of my languages is RTL and when the page is set to that language, Polylang is switching the block editor to RTL as well, making my code impossible to edit. Any idea how to fix this?

    I do see that Polylang is affecting the display of the posts being output by CCS, but if I want to display multiple languages in the results, how do I do that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filtering for language (with Polylang or WPML)’ is closed to new replies.