• Resolved Darren Cooney

    (@dcooney)


    Hi,
    I’m the developer of Ajax Load More – I have a user who says Sublanguage is not working with my plugin.

    Ajax Load More uses admin-ajax.php and WP_Query to query posts.
    For other language plugins such as WPML, Polylang and QTranslate I set the lang parameter of the WP_Query to the current language string.

    Is this how I can add support for Sublanguage as well?

    Thanks,

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,
    Unfortunatelly sublanguage uses the parameter language not lang. However you can change it by hooking into it:

    
    add_action('sublanguage_admin_init', function($sublanguage) {
    	if (wp_doing_ajax()) {
    		$sublanguage->language_query_var = "lang";
    	}
    });
    

    Please ask again if it still doesnt work.

    Thread Starter Darren Cooney

    (@dcooney)

    Thank you @max345, Ill try adding support using language.

    Cheers,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP_Query’ is closed to new replies.