Esempio n. 1
0
<?php

/**
 * The Template for displaying all single messages.
 *
 * Override this template by copying it to yourtheme/sensei/single-message.php
 *
 * @author 		Automattic
 * @package 	Sensei
 * @category    Templates
 * @version     1.9.0
 */
?>

<?php 
get_sensei_header();
?>

<article <?php 
post_class();
?>
 >

    <?php 
/**
 * Action inside the single message template before the content
 *
 * @since 1.9.0
 *
 * @param integer $message_id
 *
 /**
  * This function is specifically created for loading template files from the theme.
  *
  * This function checks if the user has overwritten the templates like in their theme. If they have it in their theme it will load the header and the footer
  * around the singular content file from their theme and exit.
  *
  * If none is found this function will do nothing. If a template is found this funciton
  * will exit execution of the script an not continue.
  *
  * @since 1.9.0
  * @param string $template
  * @param bool $load_header_footer should the file be wrapped in between header and footer? Default: true
  */
 public static function locate_and_load_template_overrides($template = '', $load_header_footer = false)
 {
     $found_template = locate_template(array($template));
     if ($found_template) {
         if ($load_header_footer) {
             get_sensei_header();
             include $found_template;
             get_sensei_footer();
         } else {
             include $found_template;
         }
         exit;
     }
 }