Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

blazeblaze on "List posts from category name. Almost - it lists all post content as well, help."

$
0
0

Hi

I'm trying to list all posts that belong to a category name generatate by sanitize_title function.

I almost achieved the result, but the code also displays whole post content.

<?php get_posts('category_name='.sanitize_title($current_user->membership_level->name).'&post_status=publish,future');?>
	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
	<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
	<?php endwhile; else: endif; ?>

How to display only posts titles and permalinks? (without posts content).

All the best
Tom


Viewing all articles
Browse latest Browse all 8245

Trending Articles