How can I Fetch posts that are stored in the different table than the default table (wp_posts)?
1 Answer
Try below code
global $wpdb;
$result = $wpdb->get_results($wpdb->prepare("SELECT * FROM TABLE_NAME));
Replace TABLE_NAME with your custom table name.
-
-
-
You can create a short code using this code and add the short code in your page template or in the edit page section. For short code please refer - speckyboy.com/… Commented Jan 24, 2017 at 13:39