Duplicated entries with get_posts
-
On my start page, I make use of the get_posts() function a couple of times. In all but one case the function works find and does what I want.
The one that doesn’t work just repeats one specific post a number of times (the post count for the specified category).
Why could this be? Some sort of conflict?
Here’s the code:
$recent_posts = get_posts('category=14');
foreach($recent_posts as $r_post) : ?>-a>" title="<?php the_title(); ?>"><?php the_title(); ?></a-
<?php endforeach; ?>
This results in this:
-a href="link-to-post" title="Hello World">Hello world</a-
-a href="link-to-post" title="Hello World">Hello world</a-
-a href="link-to-post" title="Hello World">Hello world</a-
-a href="link-to-post" title="Hello World">Hello world</a-
-a href="link-to-post" title="Hello World">Hello world</a-
I can’t find some sort of connection between things, so I’m completely clueless.
PS. Dashes are for disabling anchor tags
The topic ‘Duplicated entries with get_posts’ is closed to new replies.