Get page content
-
This is the code i’m currently using and it works:
<?php
$id=512;
$post = get_page($id);
$content = apply_filters(‘the_content’, $post->post_content);
$content = str_replace(‘]]>’, ‘]]>’, $content);
echo $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’
Thanks!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Get page content’ is closed to new replies.