I need to do the following, take the news content and your images from a page and show it on the main page (obs the current news, and this page is not in the WP only the others) follow the images with the detailed explanation
This is the main page, here where you have news that is with the news image I have to show the last news of the other pages that have the image below
Briefly:Ihavetogetthelinksandimagesofthenewsfromtheotherpages,andshowinthisindex
obs:Ihavefailedattemptsbythebank,usingthisfunction
$sql=mysql_query("SELECT DISTINCT wposts.* FROM wp_3_posts wposts
LEFT JOIN wp_3_postmeta wpostmeta ON wposts.ID = wpostmeta.post_id
LEFT JOIN wp_3_term_relationships ON (wposts.ID =
wp_3_term_relationships.object_id)
LEFT JOIN wp_3_term_taxonomy ON
(wp_3_term_relationships.term_taxonomy_id =
wp_3_term_taxonomy.term_taxonomy_id)
union
SELECT DISTINCT wposts.* FROM wp_4_posts wposts
LEFT JOIN wp_4_postmeta wpostmeta ON wposts.ID = wpostmeta.post_id
LEFT JOIN wp_4_term_relationships ON (wposts.ID =
wp_4_term_relationships.object_id)
LEFT JOIN wp_4_term_taxonomy ON
(wp_4_term_relationships.term_taxonomy_id =
wp_4_term_taxonomy.term_taxonomy_id)
union
SELECT DISTINCT wposts.* FROM wp_5_posts wposts
LEFT JOIN wp_5_postmeta wpostmeta ON wposts.ID = wpostmeta.post_id
LEFT JOIN wp_5_term_relationships ON (wposts.ID =
wp_5_term_relationships.object_id)
LEFT JOIN wp_5_term_taxonomy ON
(wp_5_term_relationships.term_taxonomy_id =
wp_5_term_taxonomy.term_taxonomy_id)
limit 6
");
I added a WHERE post_mime_type = 'image/jpeg'
and returned images but all the images on the pages, is there a way I can get only news categories?