• Hello,
    First thank you for creating a great plugin like this!
    I am creating a custom search and wanted to know where the relationship is in the post.

    See the code below:

    $query = $wpdb->get_results( 
    	"SELECT ID, post_title, post_content, post_excerpt, guid
    	FROM $wpdb->posts
    	WHERE post_status = 'publish' AND post_type = 'page' AND 
    	post_title LIKE '%$get_search_query%' OR post_content LIKE '%$get_search_query%'
    	ORDER BY ID ASC"
    );

    I can search the page, but wanted using the same code to identify the language and reduce the search in the database. That is, where is the language of the statement in the post?
    Again, thank you!

Viewing 1 replies (of 1 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    The language is a taxonomy. So you can get it as any other taxonomy.
    You can use the plugin Query Monitor to look at the current queries on your page. Thus you will see how queries are looking with Polylang active.

Viewing 1 replies (of 1 total)
  • The topic ‘Post Type get_results current language’ is closed to new replies.