I want to use the following code in my main php plugin file. I get a whole screen full of error messages.
When I put it in functions.php it works fine. Can someone advise please?
$pages = get_posts($args);
foreach($pages as $page) {
$out = get_permalink($page->ID);
}
$args
, but you haven't included that in your question, can you edit your question to include the missing code?