This is the code i’m currently using and it works:
$post = get_page($id);
$content = apply_filters(‘the_content’, $post->post_content);
$content = str_replace(‘]]>’, ‘]]>’, $content);
What I want to achieve is instead of putting that code i want to have something like this instead:
<?php echo getPageContent(8); ?>
where I just put the pageid and the other code in functions.php..
My questions is how do I transfer the working code to ‘functions.php’
- The topic ‘Get page content’ is closed to new replies.