Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If page_content() != '' echo ... possible? (conditional by content)
#2
Add the below function to admin/inc/theme_functions.php or theme/yourtheme/functions.php.
It does not matter which one you add it too.
Code:
function return_page_content() {
    global $content;
    exec_action('content-top');
    $content = strip_decode($content);
    $content = exec_filter('content',$content);
    return $content;
        /* un-comment below if you replace the get_page_content() function in your template files */
    //exec_action('content-bottom');
}

Then you can use it to return the content instead of echo it.

Or

You can do the below in your template files:
Code:
<?php
    global $content;
    if($content != '')
    {
        get_page_content();
    }
?>
Reply


Messages In This Thread
If page_content() != '' echo ... possible? (conditional by content) - by mikeh - 2012-02-29, 12:49:26



Users browsing this thread: 1 Guest(s)