wordpress blog connects with php website -
I have a WordPress blog and php website. I want to put information about new articles on the WordPress blog on the php website. I did something. I have the title of articles
Mysql_connect ("LocalHost", "...", "...."); Mysql_select_db ("...", $ db); $ Result_redaktor = mysql_query ("SELECT * fp wp_posts WHERE Post_Status = 'Post Order' post_Data DESC LIMIT 10", $ db); If (! $ Result_redaktor) {exit (mysql_error ()); } If (mysql_num_rows ($ result_redaktor)> 0) {$ myrow_redaktor = mysql_fetch_array ($ result_redaktor); Do {printf ("& lt; div class = 'main' & gt; & lt; a href = 'http: //redaktor.11klassniki.ru/%s'>% s & lt; / a & gt; Lt; / div & gt; ", $ myrow_redaktor [" guid "], $ myrow_redaktor [" post_title "]); } While ($ myrow_redaktor = mysql_fetch_array ($ result_redaktor)); } And {resonate "& lt; p & gt; no data. & Lt; / p & gt;"; Go out (); } Includes ("block / bd.fp"); ? & Gt;
I do not know how to get the featured images and text (lead, which goes more than the tag first).
PS My site and my blog are in the same hosting
This code allows to view the title. It works. But I need to add images for titles.
How can I customize the next code
$ thumbnails = get_posts ('numberposts = 10'); Forex Currency ($ thumbnail as $ thumbnail) {If (po_stable ($ thumbnail-> ID)) {echo '
Post_title). '' & Gt; ';' echo get_the_post_thumbnail ($ thumbnail- & Echo get_the_post_thumbnail ($ post_id, $ size, $ attr); Read this article for more information: Or, if your site and your blog If you are in the same hosting, then you should include the wp-load.php file in your php site and all the f You should use WordPress.
:
// Include wp-load'er included ('wp-load.php'); // Previous Receive 10 posts // Return posts as arrays instead of posts to be found 'Objects $ recent_page = wp_get_recent_posts (array (' numberposts' = & gt; 10)) // Do something with them that resonates Is
ul & gt; '; ($ post [' id ']),' '& gt;' $ post ['post_title'], 'and lieutenant ($ Recent_posts as $ post) {echo & lt ; Li & gt; & Lt; your code's Enjoy!
Comments
Post a Comment