I got client that built a learning course with wordpress. The learning course has 8 categories and within each category there are 20-50 posts assigned in order.
I am trying to figure out a way to extract all of the posts in order from the database only from the 8 specific categories. I do not want all of the pages and post that are not apart of the learning course as the course is only a portion of the site.
The end goal is to have the ability to take the content and migrate it to a custom built solution for the course.
What I really need to pull would be post_title, post_slug, post_content, category_id, order_id (doubt that is actual table row names but get the idea of what i am trying to pull).
I looked around and saw the relationship to get all of the posts with category relationships similar to this.
SELECT p.*, t.* FROM wp_posts p LEFT JOIN wp_term_relationships rel ON rel.object_id = p.ID LEFT JOIN wp_term_taxonomy tax ON tax.term_taxonomy_id = rel.term_taxonomy_id LEFT JOIN wp_terms t ON t.term_id = tax.term_id
But not sure how to narrow it down as that is grabbing everything. I am novice at wordpress and go start digging into the docs to see what I can figure out but figure it will take me a long time to get what I need. I figure there might be someone out there who know a simple tweak to this to help and save me a lot of time. Appreciate any help. Thanks