Exemplo n.º 1
0
 function content($block)
 {
     $content = parent::get_setting($block, 'content');
     if ($content != null) {
         echo headway_parse_php(do_shortcode(stripslashes($content)));
     } else {
         echo '<p>There is no custom code to display.</p>';
     }
 }
Exemplo n.º 2
0
 /**
  * Callback function to be used for displaying the footer scripts.
  * 
  * @uses headway_parse_php()
  **/
 public static function footer_scripts()
 {
     echo "\n" . headway_parse_php(HeadwayOption::get('footer-scripts')) . "\n";
 }
Exemplo n.º 3
0
 function display_entry($args = array())
 {
     global $post;
     $defaults = array('count' => false, 'single' => false);
     $args = array_merge($defaults, $args);
     if ($this->get_setting('show-entry', true)) {
         /* Setup generic variables */
         $post_id = get_the_id();
         $post_class = $this->entry_class();
         $post_permalink = get_permalink();
         $post_type = get_post_type();
         /* End generic variables */
         /* Meta */
         $entry_meta_display_post_types = $this->get_setting('show-entry-meta-post-types', array('post'));
         if (is_array($entry_meta_display_post_types) && in_array($post_type, $entry_meta_display_post_types)) {
             $entry_meta_above = $this->parse_meta($this->get_setting('entry-meta-above', 'Posted on %date% by %author% &bull; %comments%'));
             $entry_utility_below = $this->parse_meta($this->get_setting('entry-utility-below', 'Filed Under: %categories%'));
             if ($entry_meta_above) {
                 $entry_meta_above = '<div class="entry-meta entry-meta-above">' . headway_parse_php($entry_meta_above) . '</div><!-- .entry-meta -->';
             }
             if ($entry_utility_below) {
                 $entry_utility_below = '<div class="entry-utility entry-utility-below entry-meta">' . headway_parse_php($entry_utility_below) . '</div><!-- .entry-utility -->';
             }
         } else {
             $entry_meta_above = null;
             $entry_utility_below = null;
         }
         /* End Meta */
         /* Setup Titles */
         $hide_title = HeadwayLayoutOption::get($post_id, 'hide-title', false, false);
         if ($post_type == 'page') {
             $alternate_title = HeadwayLayoutOption::get($post_id, 'alternate-title', false, false);
         }
         $post_title = isset($alternate_title) && $alternate_title ? $alternate_title : get_the_title();
         $post_title_tooltip = sprintf(esc_attr__('%s', 'headway'), the_title_attribute('echo=0'));
         /* Show <h1> for titles if it's a singlular page, use <h3> for archives, and <h2> for everything else. */
         if (is_singular() && $this->get_setting('mode', 'default') == 'default') {
             $title_tag = 'h1';
         } elseif (is_archive() || is_search()) {
             $title_tag = 'h3';
         } else {
             $title_tag = 'h2';
         }
         /* If the post is singular or the post type is a page being displayed through content fetching, don't put a link in the title. */
         if (is_singular() && $this->get_setting('mode', 'default') != 'custom-query') {
             $post_title_link = $post_title;
         } else {
             $post_title_link = '<a href="' . $post_permalink . '" title="' . $post_title_tooltip . '" rel="bookmark">' . $post_title . '</a>';
         }
         /* End Titles */
         do_action('headway_before_entry', $args);
         echo '<div id="post-' . $post_id . '" class="' . $post_class . '">';
         do_action('headway_entry_open', $args);
         //Show post thumbnail
         $this->display_thumbnail($post, 'above-title');
         do_action('headway_before_entry_title', $args);
         //Show the title based on the Show Titles option
         if ($this->get_setting('show-titles', true) && !($hide_title == 'singular' && $title_tag == 'h1') && !($hide_title == 'list' && $title_tag != 'h1') && !($hide_title == 'both')) {
             echo '<' . $title_tag . ' class="entry-title">';
             echo $post_title_link;
             if (apply_filters('headway_show_edit_link', $this->get_setting('show-edit-link', true))) {
                 edit_post_link('Edit Entry');
             }
             echo '</' . $title_tag . '>';
         }
         do_action('headway_after_entry_title', $args);
         echo $entry_meta_above;
         $this->display_thumbnail($post, 'above-content');
         $this->display_entry_content($args);
         echo $entry_utility_below;
         do_action('headway_entry_close', $args);
         echo '</div><!-- #post-' . $post_id . ' -->';
         do_action('headway_after_entry', $args);
         $this->display_post_navigation();
     }
     //show-entry check
     $this->display_comments($args);
 }