Word Press Categories

This query provides the Categorized Pages in Word Press

SELECT
    `p`.`ID` AS `post_id`,
    `p`.`post_title` AS `post_title`,
    `p`.`post_name` AS `post_slug`,
    `p`.`post_type` AS `post_type`,
    `p`.`guid` AS `post_url_string`,
    `t`.`term_id` AS `category_id`,
    `t`.`name` AS `category_name`,
    `t`.`slug` AS `category_slug`
FROM
    (
        (
            (
                `wp-cr`.`wp_posts` `p`
            JOIN `wp-cr`.`wp_term_relationships` `r`
            ON
                ((`r`.`object_id` = `p`.`ID`))
            )
        JOIN `wp-cr`.`wp_terms` `t`
        ON
            (
                (`t`.`term_id` = `r`.`term_taxonomy_id`)
            )
        )
    JOIN `wp-cr`.`wp_term_taxonomy` `tx`
    ON
        ((`tx`.`term_id` = `t`.`term_id`))
    )
WHERE
    (`tx`.`taxonomy` = 'category')
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License