WordPress.org

Ready to get started?Download WordPress

Forums

Get all posts from a category? (3 posts)

  1. tipem
    Member
    Posted 5 years ago #

    Hey,

    I was just wondering, what's the MySQL query to get ALL of the posts from ONE category (e.g., select * from wp_posts where category = ###). I just need the page title and page slug (url) from the table. I'm trying to generate my own dynamic menus. From the SQL table structure that I'm seeing, I see no coherence on how to do that...

    Thanks in advanced,

    Tipem

  2. moshu
    Member
    Posted 5 years ago #

    Maybe you should get first familiar with the tool you are using before making these grandious plans of messing with the database and creating your "dynamic menus" (whatever that is).

    Posts and Pages are two different things, but you taalk about them as if they were interchangeable.
    Clicking on a category name it will display only posts from that category. Whether all or just a X number with 'paged' view - it's up to you; you can use a plugin to set different # of posts in different views.
    What is displayed on your category archive view is determined by your Category_Templates.

    So, don't tink you know the "how-to". Just describe WHAT do you want to achieve, in plain English, no technical mambo-jambo, and some experinced helpers will tell you HOW to do it.

  3. tipem
    Member
    Posted 5 years ago #

    I figured it out. The function I needed was [b]get_posts()[/b]. Solved!

Topic Closed

This topic has been closed to new replies.

About this Topic