How to Fetch post from database:
<?php
$getpostdraft = $wpdb->get_results( " SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = 5 " ); foreach ( $getpostdraft as $drft) { echo $drft->post_title; }
?>
WordPress Tutorials for beginners
<?php
$getpostdraft = $wpdb->get_results( " SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = 5 " ); foreach ( $getpostdraft as $drft) { echo $drft->post_title; }
?>
0 comments:
Post a Comment