recent post in individual index page
-
I have my start page as an individual index.php, here i have the following code to display the recent post in my blog:
<?php
$how_many=1;
require_once(‘blog/wp-config.php’);
?><?
$news=$wpdb->get_results(“SELECTID
,post_title
,post_content
,post_date
FROM $wpdb->posts
WHEREpost_type
=\”post\” ANDpost_status
=\”publish\” ORDER BY post_date DESC LIMIT $how_many”);
foreach($news as $np){
printf (“%s“, get_permalink($np->ID),$np->post_title);
printf (“%s“, get_permalink($np->ID),$np->post_content);
} ?>Here i am having problems with the last two print lines since i am completely new to all this.
the .. printf (“%s
“, get_permalink($np->ID),$np->post_title); .. works just fine but i wanted to make this bold. what do i add in my css ?
and here … printf (“%s“, get_permalink($np->ID),$np->post_content); … the actual body text shows up as a link which i dont want. how do i remove the link on this line.
Finally is there any way i can add a text limit ? like say 50 chars and then a ” read more ..” comes up after the limit is met ?
Cheers, and thanks in advance.
- The topic ‘recent post in individual index page’ is closed to new replies.