Example #1
0
 function dynamicnews_display_postmeta()
 {
     // Get Theme Options from Database
     $theme_options = dynamicnews_theme_options();
     // Display Date unless user has deactivated it via settings
     if (true == $theme_options['meta_date']) {
         dynamicnews_meta_date();
     }
     // Display Author unless user has deactivated it via settings
     if (true == $theme_options['meta_author']) {
         dynamicnews_meta_author();
     }
     // Display Comments
     if (comments_open()) {
         dynamicnews_meta_comments();
     }
     edit_post_link(esc_html__('Edit Post', 'dynamic-news-lite'));
 }
 function display_postmeta($settings)
 {
     // Start Output Buffering
     ob_start();
     // Display Date unless deactivated
     if ($settings['postmeta'] > 0) {
         dynamicnews_meta_date();
     }
     // Display Author unless deactivated
     if ($settings['postmeta'] == 2) {
         dynamicnews_meta_author();
     }
     // Display Comments
     if ($settings['postmeta'] == 3 and comments_open()) {
         dynamicnews_meta_comments();
     }
     // Save Output Buffer
     $meta_output = ob_get_contents();
     // Delete Buffer
     ob_end_clean();
     // Only display output if there is postmeta
     if ($meta_output != false) {
         echo '<div class="entry-meta postmeta">' . $meta_output . '</div>';
     }
 }
 function display_postmeta($instance)
 {
     // Get Widget Settings
     $defaults = $this->default_settings();
     extract(wp_parse_args($instance, $defaults));
     // Start Output Buffering
     ob_start();
     // Display Date unless deactivated
     if ($postmeta > 0) {
         dynamicnews_meta_date();
     }
     // Display Author unless deactivated
     if ($postmeta == 2 or $postmeta == 4) {
         dynamicnews_meta_author();
     }
     // Display Comments
     if ($postmeta >= 3 and comments_open()) {
         dynamicnews_meta_comments();
     }
     // Save Output Buffer
     $meta_output = ob_get_contents();
     // Delete Buffer
     ob_end_clean();
     // Only display output if there is postmeta
     if ($meta_output != false) {
         echo '<div class="postmeta">' . $meta_output . '</div>';
     }
 }