/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* * Grabs the text content from a Page that is meant to be a blurb * on another Page. * 1. Create a Page and insert text to be used as the blurb. * 2. Give the post slug a name. * 3. Call get_blurb() from where the blurb should be inserted. * * @param pagename - post slug of the Page * @param keeptags - tag list to allow in the text * @return String - the blurb */ function get_blurb ($pagename, $keeptags='') { $q = new WP_Query('pagename='.$pagename); $content = ''; if ($content = $q->queried_object->post_content) { } else { $content = 'This blurb does not exist. '; } return $content; } function beautify_blurb ($content, $isIndex=FALSE) { if ($isIndex) { } else { } }