2 - VARIABLES 3 - FUNCTION - Add another one view - Get number of views */ /*=============================================== I N C L U D E S Required includes ===============================================*/ define('WP_USE_THEMES', false); require_once '../../../../../../wp-load.php'; /*=============================================== V A R I A B L E S Regured variables ===============================================*/ $st_['st_id'] = isset($_GET['id']) ? esc_html($_GET['id']) : ''; /*=============================================== F U N C T I O N Major functions ===============================================*/ // Add another one view st_setPostViews($st_['st_id']); // Get number of views echo st_getPostViews($st_['st_id']);
function st_post_meta($format = true, $date = true, $category = true, $comments = true, $tags = true, $views = false, $permalink = false) { global $st_Options, $st_Settings, $post; $st_ = array(); // Post type names $st_['st_post'] = !empty($st_Settings['ctp_post']) ? $st_Settings['ctp_post'] : $st_Options['ctp']['post']; $st_['st_category'] = !empty($st_Settings['ctp_category']) ? $st_Settings['ctp_category'] : $st_Options['ctp']['category']; $st_['st_tag'] = !empty($st_Settings['ctp_tag']) ? $st_Settings['ctp_tag'] : $st_Options['ctp']['tag']; // Post format $st_['format'] = get_post_format($post->ID) && $st_Options['global']['post-formats'][get_post_format($post->ID)]['status'] ? get_post_format($post->ID) : 'standard'; ?> <div class="meta"> <?php // If meta enabled if (!isset($st_Settings['post_meta']) || !empty($st_Settings['post_meta']) && $st_Settings['post_meta'] == 'yes') { /*------------------------------------------- 4.10.1 - Post format -------------------------------------------*/ if ($format == true && function_exists('st_kit')) { if ($st_['format'] != 'standard') { $st_['format_label'] = $st_Options['global']['post-formats'][$st_['format']]['label']; echo '<span class="ico16 ico16-' . $st_['format'] . '"><a href="' . get_post_format_link($st_['format']) . '">' . $st_['format_label'] . '</a></span>'; } } /*------------------------------------------- 4.10.2 - Date -------------------------------------------*/ if ($date == true) { echo '<span class="ico16 ico16-calendar">'; if (!empty($st_Settings['nice_time']) && $st_Settings['nice_time'] == 'yes' && function_exists('st_niceTime')) { $st_['date'] = st_niceTime($post->post_date_gmt); } else { $st_['date'] = get_the_time(get_option('date_format'), $post->ID); } if (is_single()) { echo $st_['date']; } else { echo '<a href="' . get_permalink() . '">' . $st_['date'] . '</a>'; } echo '</span>'; } /*------------------------------------------- 4.10.3 - Comments -------------------------------------------*/ if ($comments == true) { if (!empty($st_Settings['post_comments']) && $st_Settings['post_comments'] == 'yes' && comments_open() && get_comments_number() != 0) { ?> <span class="ico16 ico16-comment-2"><?php if ($comments === true) { comments_popup_link(__('Leave a reply', 'strictthemes'), __('1 Comment', 'strictthemes'), __('% Comments', 'strictthemes'), '', ''); } else { comments_popup_link('0', '1', '%', '', ''); } ?> </span><?php } } /*------------------------------------------- 4.10.4/5 - Category & Tags -------------------------------------------*/ if ($post->post_type != 'page') { // If project if (get_post_type() == $st_['st_post']) { if ($category == true && ($st_['posted_in'] = st_wp_get_post_terms($post->ID, $st_['st_category']))) { echo '<span class="ico16 ico16-folder">' . $st_['posted_in'] . '</span>'; } if ($tags == true && ($st_['tagged_by'] = st_wp_get_post_terms($post->ID, $st_['st_tag']))) { echo '<span class="ico16 ico16-tag">' . $st_['tagged_by'] . '</span>'; } } else { if ($category == true) { ?> <span class="ico16 ico16-folder"><?php the_category(', '); ?> </span><?php } if ($tags == true) { the_tags('<span class="ico16 ico16-tag">', ', ', '</span>'); } } } /*------------------------------------------- 4.10.6 - Views -------------------------------------------*/ if ($views == true) { if (!empty($st_Settings['post_views']) && $st_Settings['post_views'] == 'yes' && function_exists('st_getPostViews')) { echo '<span class="ico16 ico16-views">' . st_getPostViews($post->ID) . '</span>'; } } /*------------------------------------------- 4.10.7 - Permalink -------------------------------------------*/ if ($permalink == true) { ?> <span class="ico16 ico16-link"><a href="<?php the_permalink(); ?> "><?php echo $permalink === true ? get_permalink() : $permalink; ?> </a></span><?php } } ?> </div><!-- .meta --><?php }