1get_header();
2function get_records()
3{
4 //$con=connectsql();
5 $records=$wpdb->query("SELECT * FROM $wpdb->posts WHERE post_type = 'elements' AND post_status = 'publish'");
6 $all=array();
7 while($data=$records->fetch_assoc())
8 {
9 $all[]=$data;
10 }
11 return $all;
12}
1
2 $records=$wpdb->query("SELECT * FROM $wpdb->posts WHERE post_type = 'elements' AND post_status = 'publish'");
3
4 while($data=$records->fetch_assoc())
5 {
6 print_r($data);
7 }
8
9}