• Resolved miltonbarboza

    (@miltonbarboza)


    Hi,
    I have the “Latest Blog Posts” option enabled on my home layout and I want to have it enabled for the main language but not for the second language. How can I remove it?
    If it is not possible to remove it, can I have this session only in English for all the languages (since I will not translate the posts)

    PS: I think that since I don’t have any post translated to other languages, the “Latest from the Blog” message in the home should be automatically hidden.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey,
    Which multi lingual plugin are you using?

    Can you post a link to your site?

    Ben

    Thread Starter miltonbarboza

    (@miltonbarboza)

    Thanks for your response, Ben.
    I am using Polylang
    English – http://www.greatlakeshelicopter.ca/
    Portuguese – http://www.greatlakeshelicopter.ca/pt/

    • This reply was modified 8 years, 10 months ago by miltonbarboza.
    • This reply was modified 8 years, 10 months ago by miltonbarboza.

    OK, so if you would like the posts to show in English while on the Portuguese pages I don’t know of a way to set that in polylang. I know you can if you’re using WPML but you would need to check with polylang support to see if you can force a default language to show if there are no translations available. I think this would be important because you wouldn’t want someone from say Brazil not knowing that you had a blog on your site especially when you consider how easy google translation works in browsers.

    Or if you would like to hide the latest posts you can use this css:

    html[lang="pt-BR"] .home .home_blog {
        display: none;
    }

    I hope that helps,

    Ben

    Thread Starter miltonbarboza

    (@miltonbarboza)

    Thank you Ben, that worked well.

    I checked with Polylang and the only way to have the the posts in English for any language is duplicating the posts. This option is also available in the Pro version and I think you could synchronize it, so you don’t need to duplicate manually.

    Thread Starter miltonbarboza

    (@miltonbarboza)

    Hi Ben,

    I looked into the php files of Polylang and found a solution for this:
    File -> polylang/frontend/frontend.php

    public function parse_query( $query ) {
    	// Allow filtering recent posts and secondary queries by the current language
    	if ( ! empty( $this->curlang ) ) {
    		//$pll_query->filter_query( $this->curlang ); //original
    		$pll_query->filter_query( '' ); //added by Milton to get posts in all languages 
    	}
    • This reply was modified 8 years, 9 months ago by miltonbarboza.
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Latest blog posts & multi-language’ is closed to new replies.