I have created a complete new php page – favorits.php. This page becomes ‘included’ in my wp template.
In this page I want to display the recent posts. I have used this code:
- “><?php the_title(); ?> — <?php the_excerpt(); ?>
$posts = get_posts(‘numberposts=5&offset=1&category=1’);
foreach($posts as $post) :
<?php endforeach; ?>
But when looking at this page I get an error:
“Fatal error: Call to undefined function get_posts() in /home/sites/site194/web/cms/wp-content/themes/hemingway/favorits.php on line 15”
This own creation php file is located in the theme directory!
Anyone, any idea what could be wrong here? Thanks in advance,
- The topic ‘get recent posts problems’ is closed to new replies.