<div align="center"><?php $title = __('New Posts', 'ktai_style'); $url = ks_blogurl(KTAI_NOT_ECHO); $ks_settings['need_front'] = false; if (get_option('show_on_front') == 'page') { if ($post_id = get_option('page_for_posts')) { $url = get_permalink($post_id); $ks_settings['need_front'] = true; } else { $title = __('Front Page', 'ktai_style'); } } if (ks_is_front()) { echo $title; } else { ks_ordered_link(1, 10, $url, $title); } ?> | <?php $title = ks_option('ks_separate_comments') ? __('Recent Comments/Pings', 'ktai_style') : __('Recent Comments', 'ktai_style'); if (ks_is_menu('comments')) { echo $title; } else { ks_ordered_link(2, 10, ks_blogurl(KTAI_NOT_ECHO) . '?menu=comments', $title); } ?> </div> <hr color="<?php echo $ks_settings['hr_color']; ?> " />
public function load_template() { if (is_404() && ($template = $this->query_template('404'))) { return $template; } elseif (ks_is_menu()) { if ($template = $this->menu_template()) { return $template; } // return NULL; } elseif (is_search() && ($template = $this->query_template('search'))) { return $template; } elseif (is_tax() && ($template = $this->get_taxonomy_template())) { return $template; } elseif (is_home() && ($template = $this->get_home_template())) { return $template; } elseif (is_attachment() && ($template = $this->get_attachment_template())) { remove_filter('the_content', 'prepend_attachment'); return $template; } elseif (is_single() && ($template = $this->query_template('single'))) { return $template; } elseif (is_page() && ($template = $this->get_page_template())) { return $template; } elseif (is_category() && ($template = $this->get_category_template())) { return $template; } elseif (is_tag() && ($template = $this->get_tag_template())) { return $template; } elseif (is_author() && ($template = $this->query_template('author'))) { return $template; } elseif (is_date() && ($template = $this->query_template('date'))) { return $template; } elseif (is_archive() && ($template = $this->query_template('archive'))) { return $template; } elseif (is_paged() && ($template = $this->query_template('paged'))) { return $template; } elseif (file_exists($this->template_dir . 'index.php')) { if (is_attachment()) { add_filter('the_content', 'prepend_attachment'); } return $this->template_dir . 'index.php'; } return NULL; }
public function output() { if (is_robots() || is_feed() || is_trackback()) { return; } require dirname(__FILE__) . '/' . self::INCLUDES_DIR . '/template-tags.php'; if (is_404()) { $this->theme->bypass_admin_404(); } if (!($template = $this->theme->load_template())) { $this->ks_die(__("Can't display pages. Bacause mobile phone templates are collapsed.", 'ktai_style')); // exit; } add_filter('wp_list_categories', array($this, 'filter_tags'), 90); add_filter('wp_list_pages', array($this, 'filter_tags'), 90); add_filter('ktai_raw_content', array($this->ktai, 'shrink_pre_encode'), 9); add_filter('ktai_encoding_converted', array($this->ktai, 'shrink_pre_split'), 5); add_filter('ktai_encoding_converted', array($this->ktai, 'replace_smiley'), 7); add_filter('ktai_encoding_converted', array($this->ktai, 'convert_pict'), 9); add_filter('ktai_split_page', array($this->ktai, 'shrink_post_split'), 15); add_action('ktai_wp_head', array($this, 'disallow_index')); //$buffer = $this->ktai->get('preamble'); $buffer .= $buffer ? "\n" : ''; ob_start(); include $template; $buffer .= ob_get_contents(); ob_end_clean(); if (isset($this->admin)) { $this->admin->store_referer()->save_data(); $this->admin->unset_prev_session($Ktai_Style->admin->get_sid()); } $buffer = apply_filters('ktai_raw_content', $buffer); $buffer = apply_filters('raw_content/ktai_style.php', $buffer); // backward compatiblity $buffer = $this->encode_for_ktai($buffer); //$buffer = apply_filters('ktai_encoding_converted', $buffer); $buffer = apply_filters('encoding_converted/ktai_style.php', $buffer); // backward compatiblity $buffer = apply_filters('ktai_split_page', $buffer, $this->shrinkage->get_page_num()); $buffer = apply_filters('split_page/ktai_style.php', $buffer, $this->shrinkage->get_page_num()); // backward compatiblity $mime_type = apply_filters('ktai_mime_type', $this->ktai->get('mime_type')); $iana_charset = apply_filters('ktai_iana_charset', $this->ktai->get('iana_charset')); if (ks_is_front() || ks_is_menu('comments')) { nocache_headers(); } if (function_exists('mb_http_output')) { mb_http_output('pass'); } header("Content-Type: {$mime_type}; charset={$iana_charset}"); echo $buffer; exit; }
function ks_is_front() { global $paged; return is_home() && !ks_is_menu() && intval($paged) < 2; }