Support » Plugin: Polylang » Default language for dynamic pages (custom urls)

  • Hi,

    (Polylang 1.7.5, WP 4.2.2, custom permalink structure, static frontpage, hide language in the url, determine lang based on content).

    I have some dynamic permalinks to views that don’t have a page or post connected to them, i.e. /foo/bar that displays information from an external source so there’s no page in wp-admin.

    My issue is that my widget sidebar that is present on these pages is showing all widgets from all languages and is not filtering per the default language as set in wp-admin. pll_current_language is (obviously) giving me null, so I expect pll to pull the widgets per the default language but that doesn’t seem to be the case.

    Is this a bug or unsupported and is there something I can do to force pll to fetch the sidebar widgets for a specific language?

    https://wordpress.org/plugins/polylang/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    How do you get the content of these pages?

    Thread Starter swemaniac

    (@swemaniac)

    Hi!

    I have a rewrite rule, e.g. /items/123, which I then intercept in parse_request before WP does anything else. Here I can get the content to be displayed from wherever (external service). I then render a template by just including it.

    The $post object is null however, so that’s why I think maybe Polylang hasn’t even had the chance to do something when I call dynamic_sidebar. I thought that PLL might see that no language is current and then just use the default language.

    Am I out of luck or can I somehow coerce WP/PLL to give me the widgets based on a specified language or something? I tried initializing a post object so that $post isn’t null, but that made no difference.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Default language for dynamic pages (custom urls)’ is closed to new replies.