excerpt function, please help me!
-
Hi, can somebody please help me, I use this code to show random 5 post on home page from my category No. 1. And now it show me a title of this post, but actually I need to show me the 12 first words of this post, I read to i can use excerpt function but I am not so good in PHP and I just do not know how to import this code in my, I try it something but I always get same content 5 time… This is my code below:
<?php $rand_posts = get_posts( array ( 'cat' => '1', 'orderby' => 'rand' ) ); foreach( $rand_posts as $post ) : ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php endforeach; ?>Also on this page I have more code, but I do not know its need to show it here?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘excerpt function, please help me!’ is closed to new replies.