my website main page : http://fifago.com/
my website wp page: http://fifago.com/news/
so i want to be able to include only last 5 news [posts] on my main page http://fifago.com/ is this posible ?
my website main page : http://fifago.com/
my website wp page: http://fifago.com/news/
so i want to be able to include only last 5 news [posts] on my main page http://fifago.com/ is this posible ?
Yes. It is possible.
<?php
$temp = $wp_query;
$wp_query = null;
$wp_query= new WP_Query('category_name=news&showposts=5&order=DESC');
while(have_posts()): the_post();
// put the code according to your design
endwhile;
$wp_query = $temp;
$temp = null;
?>
Try this.
Fatal error: Class 'WP_Query' not found in /home/public_html/theme/fmd/frontpage.php on line 64 :(
http://fifago.com/ is not a wordpress site. For that reason my code would not work on this site. Write there the custom sql.
yep , as i sayed http://fifago.com/news/ here i installed wordPress but the main page is using my person system
Write there the custom sql. ? I dont understand what you want to say
Connect to the wordpress database and pick up data from there table using custom sql syntax.
is not an easier way:)? no one ever tried to do this ,to not bother and I :D
http://www.corvidworks.com/articles/wordpress-content-on-other-pages
its perfectly easy, I use this code to show my 10 latest posts on non-WP page
ok i tried this method but i am getting an error :(
Warning: Cannot modify header information - headers already sent by (output started at /home/fifagoc1/public_html/theme/fmd/html.php:54) in /home/fifagoc1/public_html/news/wp-includes/functions.php on line 3125
Error establishing a database connection
This topic has been closed to new replies.