Forums

[resolved] use database connection (2 posts)

  1. mercuryfenix
    Member
    Posted 3 years ago #

    Is there any easy way to query the WordPress database? I have an SQL query for the menu of my theme which pulls categories and their attributes straight from the terms and terms_taxonomy tables in the database. I would like to use the existing database connection that WordPress uses for everything.

    Any ideas on how I can achieve this?

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    There is wpdb

    But also consider:

    Also:
    wp_list_categories()
    get_categories()

    and for posts:
    get_posts()
    query_posts()

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags