• Resolved swagzillionaire

    (@swagzillionaire)


    Hi there!

    We’re using a MySQL Query to embed teasers of our recent WordPress Posts on a non-WP Website. We’re having a bit of a hard time figuring out how to SELECT posts from a specific language by MySQL query, has anyone done that before and could help out somehow?

    Would be the nuts.

    cheers

    https://www.ads-software.com/plugins/polylang/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Each language is a term in the ‘language’ taxonomy. You need to join your way to the wp_terms table:

    select
    p.ID
    , p.post_title
    , t.slug
    , t.name
    from wp_posts p
    inner join wp_term_relationships tr
    on tr.object_id = p.ID
    inner join wp_term_taxonomy tt
    on tt.term_taxonomy_id = tr.term_taxonomy_id and tt.taxonomy = 'language'
    inner join wp_terms t
    on t.term_id = tt.term_id

    Thread Starter swagzillionaire

    (@swagzillionaire)

    <3

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