Support » Plugins » Hacks » Add a specific category to a query

  • richard.alienmedia

    (@richardalienmediacouk)


    Hi,

    I need to only display a certain category from a query:

    $letters = $wpdb->get_col(
    “SELECT DISTINCT LEFT(post_title,1) AS first_letter FROM
    $wpdb->posts
    WHERE post_type = ‘$post_type’ AND post_status = ‘publish’
    ORDER BY first_letter ASC”
    );

    Please could someone tell me how to do this? I haven’t got the first clue!

    Thanks.

  • The topic ‘Add a specific category to a query’ is closed to new replies.