/** * Return a list of header images, both from the Tarski directory and the child * theme (if one is being used). * * @uses get_tarski_option * @uses wp_get_theme * @uses get_template_directory_uri * @uses get_stylesheet_directory_uri * * @return array */ function _tarski_list_header_images() { $headers = array(); $dirs = array('Tarski' => get_template_directory()); $current = get_tarski_option('header'); $theme = wp_get_theme(); if (strlen($theme->Template) > 0) { $dirs[$theme->Name] = get_stylesheet_directory(); } foreach ($dirs as $theme_name => $dir) { $dirpath = $dir . '/headers'; if (is_dir($dirpath)) { $header_dir = dir($dirpath); } else { continue; } while ($file = $header_dir->read()) { if (preg_match('/^[^.].+\\.(jpg|png|gif)/', $file) && !preg_match('/-thumb\\.(jpg|png|gif)$/', $file)) { $name = $theme_name . '/' . $file; $id = 'header_' . preg_replace('/[^a-z_]/', '_', strtolower($name)); $path = $dir == get_template_directory() ? '%1$s' : '%2$s'; $thumb = preg_replace('/(\\.(?:png|gif|jpg))/', '-thumb\\1', $file); $uri = $dir == get_template_directory() ? get_template_directory_uri() : get_stylesheet_directory_uri(); $is_current = is_string($current) && $current == $file || $current[0] == $theme_name && $current[1] == $file; $headers[] = array('name' => $name, 'id' => $id, 'lid' => 'for_' . $id, 'path' => "{$uri}/headers/{$file}", 'current' => $is_current, 'thumb' => "{$uri}/headers/{$thumb}", 'description' => $name, 'url' => "{$path}/headers/{$file}", 'thumbnail_url' => "{$path}/headers/{$thumb}"); } } } return $headers; }
/** * Returns the document title. * * The order (site name first or last) can be set on the Tarski Options page. * While the function ultimately returns a string, please note that filters * are applied to an array! This allows plugins to easily alter any aspect * of the title. For example, one might write a plugin to change the separator. * * @since 1.5 * @deprecated 3.2.0 * * @param string $sep * @return string * * @hook filter tarski_doctitle * Filter document titles. */ function tarski_doctitle($sep = '·') { _deprecated_function('wp_title', '3.2.0'); $site_name = get_bloginfo('name'); $content = trim(wp_title('', false)); if (is_404()) { $content = sprintf(__('Error %s', 'tarski'), '404'); } elseif (get_option('show_on_front') == 'posts' && is_home()) { $content = get_bloginfo('description', 'display'); } elseif (is_search()) { $content = sprintf(__('Search results for %s', 'tarski'), esc_html(get_search_query())); } elseif (is_month()) { $content = single_month_title(' ', false); } elseif (is_tag()) { $content = multiple_tag_titles(); } $elements = strlen($content) > 0 ? array('site_name' => $site_name, 'separator' => $sep, 'content' => $content) : array('site_name' => $site_name); if (get_tarski_option('swap_title_order')) { $elements = array_reverse($elements, true); } // Filters should return an array $elements = apply_filters('tarski_doctitle', $elements); // But if they don't, it won't try to implode if (is_array($elements)) { $doctitle = implode(' ', $elements); } echo $doctitle; }
/** * tarski_author_posts_link() - If site has more than one author, output a link to that author's archive page. * * @global object $authordata * @return string */ function tarski_author_posts_link() { global $authordata; if (get_tarski_option('show_authors')) { printf(__(' by ', 'tarski') . '<span class="vcard author"><a href="%1$s" title="%2$s" class="url fn">%3$s</a></span>', get_author_posts_url($authordata->ID, $authordata->user_nicename), sprintf(__('Articles by %s', 'tarski'), attribute_escape(get_the_author())), get_the_author()); } }
/** * TarskiVersion() - constructor for the TarskiVersion class. * * @since 2.4 */ function TarskiVersion() { $this->current_version_number(); $this->messages = array('unchecked' => array('class' => 'disabled', 'body' => sprintf(__('Update notification is disabled, so no attempt was made to access the update server. Your installed version is %s.', 'tarski'), "<strong>{$this->current}</strong>")), 'error' => array('class' => 'problem', 'body' => sprintf(__('An error occurred while attempting to access the update server. Your installed version is %s.', 'tarski'), "<strong>{$this->current}</strong>")), 'no_connection' => array('class' => 'problem', 'body' => sprintf(__('No connection to update server. Your installed version is %s.', 'tarski'), "<strong>{$this->current}</strong>"))); if (get_tarski_option('update_notification')) { $this->version_feed_data(); $this->latest_version_number(); $this->latest_version_link(); $this->version_status(); $this->latest_version_summary(); $this->messages = array_merge($this->messages, array('current' => array('class' => '', 'body' => sprintf(__('Your version of Tarski (%s) is up to date.', 'tarski'), "<strong>{$this->current}</strong>")), 'older' => array('class' => 'update-available', 'body' => sprintf(__('Version %1$s of the Tarski theme %2$s. Your installed version is %3$s.', 'tarski'), "<strong>{$this->latest}</strong>", '<a href="' . $this->latest_link . '">' . __('is now available', 'tarski') . '</a>', "<strong>{$this->current}</strong>") . "\n\n{$this->latest_summary}"), 'newer' => array('class' => '', 'body' => sprintf(__('You appear to be running a development version of Tarski (%1$s). Please ensure you %2$s.', 'tarski'), "<strong>{$this->current}</strong>", '<a href="http://tarskitheme.com/help/updates/svn/">' . __('stay updated', 'tarski') . '</a>')))); } }
/** * Generate links to the various Tarski stylesheets. * * @hook filter tarski_style_array * Filter the array of stylesheet attributes from which the stylesheet * links are generated. * * @hook filter tarski_stylesheets * Filter the raw stylesheet link elements before they're printed to * the document. */ function stylesheets() { $style_array = array('main' => array('url' => get_bloginfo('stylesheet_url')), 'screen' => array('url' => get_bloginfo('template_directory') . '/library/css/screen.css', 'media' => 'screen,projection'), 'print' => array('url' => get_bloginfo('template_directory') . '/library/css/print.css', 'media' => 'print')); if (get_tarski_option('style')) { $style_array['alternate'] = array('url' => get_bloginfo('template_directory') . '/styles/' . get_tarski_option('style')); } $style_array = apply_filters('tarski_style_array', $style_array); if (is_array($style_array)) { foreach ($style_array as $type => $values) { if (is_array($values) && $values['url']) { if (empty($values['media'])) { $values['media'] = 'all'; } $stylesheets[$type] = sprintf('<link rel="stylesheet" href="%1$s" type="text/css" media="%2$s" />', $values['url'], $values['media']); } } } $this->stylesheets = apply_filters('tarski_stylesheets', $stylesheets); }
<?php // Localisation load_theme_textdomain('tarski'); // Custom header image define('HEADER_TEXTCOLOR', ''); define('HEADER_IMAGE', '%s/headers/' . get_tarski_option('header')); // %s is theme directory URI define('HEADER_IMAGE_WIDTH', 720); define('HEADER_IMAGE_HEIGHT', 180); define('NO_HEADER_TEXT', true); add_custom_image_header('', 'tarski_admin_header_style'); // Widgets register_sidebar(array('id' => 'sidebar-main', 'name' => __('Main sidebar', 'tarski'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>')); register_sidebar(array('id' => 'sidebar-post-and-page', 'name' => __('Post and page sidebar', 'tarski'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>')); register_sidebar(array('id' => 'footer-main', 'name' => __('Footer main widgets', 'tarski'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>')); register_sidebar(array('id' => 'footer-sidebar', 'name' => __('Footer sidebar widgets', 'tarski'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>')); // Tarski widgets register_sidebar_widget(__('Recent Articles', 'tarski'), 'tarski_recent_entries'); // Widget filters add_filter('widget_text', 'tarski_content_massage'); add_filter('widget_text', 'tarski_widget_text_wrapper'); add_filter('widget_links_args', 'tarski_widget_links_args'); if (is_admin()) { // Generate messages add_filter('tarski_messages', 'tarski_update_notifier'); // Output messages on dashboard and options page add_action('admin_notices', 'tarski_messages'); // Tarski Options page add_action('admin_print_styles', 'tarski_admin_style'); add_action('admin_print_scripts-design_page_tarski-options', 'tarski_inject_scripts');
<?php while (have_posts()) { the_post(); ?> <?php if (get_tarski_option('asidescategory') && in_category(get_tarski_option('asidescategory'))) { // Aside loop ?> <div class="aside hentry" id="p-<?php the_ID(); ?> "> <div class="content entry-content"><?php the_content(__('Read the rest of this entry »', 'tarski')); ?> </div> <p class="meta"><span class="date updated"><?php the_time(get_option('date_format')); ?> </span><?php tarski_author_posts_link(); ?> | <a class="comments-link" rel="bookmark" href="<?php the_permalink(); ?> "><?php
/** * tarski_update_notifier() - Performs version checks and outputs the update notifier. * * Creates a new Version object, checks the latest and current * versions, and lets the user know whether or not their version * of Tarski needs updating. The way it displays varies slightly * between the WordPress Dashboard and the Tarski Options page. * @since 2.0 * @param string $location * @return string */ function tarski_update_notifier($messages) { global $plugin_page; if (!is_array($messages)) { $messages = array(); } $version = new Version(); $version->current_version_number(); $svn_link = 'http://tarskitheme.com/help/updates/svn/'; // Update checking only performed when remote files can be accessed if (can_get_remote()) { // Only performs the update check when notification is enabled if (get_tarski_option('update_notification')) { $version->latest_version_number(); $version->latest_version_link(); $version->version_status(); if ($version->status == 'older') { $messages[] = sprintf(__('A new version of the Tarski theme, version %1$s %2$s. Your installed version is %3$s.', 'tarski'), "<strong>{$version->latest}</strong>", '<a href="' . $version->latest_link . '">' . __('is now available', 'tarski') . '</a>', "<strong>{$version->current}</strong>"); } elseif ($plugin_page == 'tarski-options') { switch ($version->status) { case 'current': $messages[] = sprintf(__('Your version of Tarski (%s) is up to date.', 'tarski'), "<strong>{$version->current}</strong>"); break; case 'newer': $messages[] = sprintf(__('You appear to be running a development version of Tarski (%1$s). Please ensure you %2$s.', 'tarski'), "<strong>{$version->current}</strong>", "<a href=\"{$svn_link}\">" . __('stay updated', 'tarski') . '</a>'); break; case 'no_connection': case 'error': $messages[] = sprintf(__('No connection to update server. Your installed version is %s.', 'tarski'), "<strong>{$version->current}</strong>"); break; } } } elseif ($plugin_page == 'tarski-options') { $messages[] = sprintf(__('Update notification for Tarski is disabled. Your installed version is %s.', 'tarski'), "<strong>{$version->current}</strong>"); } } return $messages; }
<select name="asides_category" id="asides_category"> <option <?php if (!get_tarski_option('asidescategory')) { echo 'selected="selected" '; } ?> value="0"><?php _e('Disable asides', 'tarski'); ?> </option> <?php $asides_cats =& get_categories('hide_empty=0'); if ($asides_cats) { foreach ($asides_cats as $cat) { if ($cat->cat_ID == get_tarski_option('asidescategory')) { $status = 'selected ="selected" '; } else { $status = false; } echo '<option ' . $status . 'value="' . $cat->cat_ID . '">' . $cat->cat_name . '</option>'; } } ?> </select> <p><?php echo __('This option will make Tarski display posts from the selected category in the ', 'tarski') . '<a href="http://photomatt.net/2004/05/19/asides/">' . __('Asides', 'tarski') . '</a>' . __(' format. Asides are short posts, usually only a single paragraph, and Tarski displays them in a condensed format without titles.', 'tarski'); ?> </p>
</div> <!-- /meta --> <?php if (get_the_content() != "") { ?> <div class="content"> <?php the_content(); ?> </div> <!-- /content --> <?php } ?> <div class="bookmarks"> <?php wp_list_bookmarks(array('exclude_category' => get_tarski_option('nav_extlinkcat'), 'category_before' => '', 'category_after' => '', 'title_before' => '<h3>', 'title_after' => '</h3>', 'show_images' => 0, 'show_description' => 0)); ?> </div> <!-- /bookmarks --> <?php th_postend(); ?> </div> <!-- /primary --> <?php } } ?>
} if ($style_dir && $styles) { ?> <select name="alternate_style" id="alternate_style" size="1"> <option<?php if (!get_tarski_option('style')) { echo ' selected="selected"'; } ?> value=""><?php _e('Default style', 'tarski'); ?> </option> <?php foreach ($styles as $style) { if (get_tarski_option('style') == $style) { $status = ' selected="selected"'; } else { $status = false; } printf('<option%1$s value="%2$s">%3$s</option>' . "\n", $status, $style, $style); } ?> </select> <?php } ?> <?php if (detectWPMU()) { // WPMU users
?> </div> <div class="span"> <?php tarski_options_block('header_images', __('Header Images', 'tarski')); ?> </div> <div class="primary"> <?php tarski_options_fn_block('tarski_miscellaneous_options', __('Miscellaneous Options', 'tarski')); ?> </div> </form> <?php if (get_option('tarski_options') && !get_tarski_option('deleted')) { ?> <div class="secondary"> <?php tarski_options_block('reset_options', __('Reset Options', 'tarski')); ?> </div> <?php } ?> <div class="clearer"></div> </div>
/** * Append tags to posts. * * @since 2.0 * * @return void */ function add_post_tags() { if (is_404()) { return; } $aside = has_post_format('aside') || in_category(get_tarski_option('asidescategory')); if (is_singular() || get_tarski_option('tags_everywhere') && !$aside) { $tag_html = '<p class="tagdata"><strong>' . __('Tags', 'tarski') . ':</strong> '; the_tags($tag_html, ', ', '</p>' . "\n"); } }
?> <?php } ?> </select> <p><?php printf(__('You can add or edit links on the %s page. We recommend creating a link category specifically for the links you want displayed in your navbar, but you can use any category.', 'tarski'), '<a href="' . admin_url('link-manager.php') . '">' . __('Manage Links', 'tarski') . '</a>'); ?> </p> </div> <div class="option"> <label for="opt-nav-homename"><?php _e('Rename your ‘Home’ link', 'tarski'); ?> </label> <input type="hidden" name="home_link_name" value="Home" /> <input class="text" type="text" id="opt-nav-homename" name="home_link_name" value="<?php if (get_tarski_option('home_link_name')) { echo get_tarski_option('home_link_name'); } else { _e('Home', 'tarski'); } ?> " /> <p><?php _e('This link is not displayed when you have a static front page.', 'tarski'); ?> </p> </div>
<?php $styles = _tarski_list_alternate_styles(); if (count($styles) > 0) { ?> <select name="alternate_style" id="alternate_style" size="1"> <option<?php if (!get_tarski_option('style')) { echo ' selected="selected"'; } ?> value=""><?php _e('Default style', 'tarski'); ?> </option> <?php foreach ($styles as $style) { printf('<option%1$s value="%2$s">%3$s</option>' . "\n", $style['current'] ? ' selected="selected"' : '', $style['name'], $style['public']); } ?> </select> <?php } ?> <?php if (is_multisite()) { // WP Multisite users ?> <p><?php _e('Tarski allows you to select an alternate style that modifies the default one. Choose from the list above.', 'tarski');
/> <?php _e('Update notification on (recommended)', 'tarski'); ?> </label> <label for="update-off"><input type="radio" id="update-off" name="update_notification" value ="off" <?php if (!get_tarski_option('update_notification')) { echo 'checked="checked" '; } ?> /> <?php _e('Update notification off', 'tarski'); ?> </label> <?php if (!cache_is_writable('version.atom') && get_tarski_option('update_notification')) { ?> <p><?php printf(__('The version check could not be cached. To enable caching, follow the tutorial on the %s page.', 'tarski'), '<a href="http://tarskitheme.com/help/updates/notifier/">' . __('update notifier', 'tarski') . '</a>'); ?> </p> <?php } ?> <?php } else { ?> <h4><?php _e('Update Notification', 'tarski'); ?> </h4>
<p><?php _e('The sidebar for posts and pages can be the same as that for index pages, or use its own set of widgets.', 'tarski'); ?> </p> <label for="sidebar-pp-type"> <input type="hidden" name="sidebar_pp_type" value="0" /> <input type="checkbox" id="sidebar-pp-type" name="sidebar_pp_type" value="main" <?php if (get_tarski_option('sidebar_pp_type') == 'main') { echo 'checked="checked" '; } ?> /> <?php _e('Same content as main sidebar?', 'tarski'); ?> </label>
/** * Returns checkbox markup for a given Tarski option. * * @since 2.4 * * @param string $name * @param string $label * @return string */ function tarski_option_checkbox($name, $label) { $id = "tarski_option_{$name}"; $checked = ''; if (get_tarski_option($name)) { $checked = 'checked="checked" '; } $hidden = "<input type=\"hidden\" name=\"{$name}\" value=\"0\" />"; $checkbox = "<input type=\"checkbox\" id=\"{$id}\" name=\"{$name}\" value=\"1\" {$checked}/>"; return sprintf("<label for=\"%s\">\n\t%s\n\t%s\n\t%s\n</label>", $id, $hidden, $checkbox, $label); }
?> "> <?php the_title(); ?> </a> </h2> <?php echo th_post_metadata(); ?> </div> <div class="content entry-content clearfix"> <?php if (!get_tarski_option('featured_header')) { echo tarski_post_thumbnail(); } ?> <?php the_content(__('Read the rest of this entry »', 'tarski')); ?> </div> <?php th_postend(); ?> </div> <?php } }
/** * tarski_bodyclass() - Returns the classes that should be applied to the document body. * * @since 1.2 * @param boolean $return * @return string $classes * @hook filter tarski_bodyclass * Filter the classes applied to the document body by Tarski. */ function tarski_bodyclass($return = false) { if (get_tarski_option('centred_theme')) { // Centred or not $classes[] = 'centre'; } if (get_tarski_option('swap_sides')) { // Swapped or not $classes[] = 'janus'; } if (get_tarski_option('style')) { // Alternate style $stylefile = get_tarski_option('style'); $stylename = str_replace('.css', '', $stylefile); if (is_valid_tarski_style($stylefile)) { $classes[] = $stylename; } } if (get_bloginfo('text_direction') == 'rtl') { $classes[] = 'rtl'; } // Filters should return an array $classes = apply_filters('tarski_bodyclass', $classes); // But if they don't, it won't implode if (is_array($classes)) { $classes = implode(' ', $classes); } if ($return) { return $classes; } else { echo $classes; } }
/** * tarski_output_nosidebarinclude() - Outputs $noSidebarInclude variable from constants.php. * * @since 1.5 * @global string $noSidebarInclude * @return string $noSidebarInclude */ function tarski_output_nosidebarinclude() { global $noSidebarInclude; if (get_tarski_option('sidebar_pp_type') == 'none' && (is_single() || is_page())) { if (!is_page_template('archives.php')) { tarski_output_constant($noSidebarInclude); } } }
/** * tarski_recent_entries() - Recent entries á la Tarski. * * Basically a ripoff of the WP widget function wp_widget_recent_entries(). * @since 2.0.5 * @see wp_widget_recent_entries() * @global object $posts * @return string */ function tarski_recent_entries($args) { if ($output = wp_cache_get('tarski_recent_entries')) { return print $output; } ob_start(); extract($args); global $posts; // Allow for configuration in the future $options = array(); // $options = get_option('tarski_recent_entries'); $title = empty($options['title']) ? __('Recent Articles', 'tarski') : $options['title']; if (!($number = (int) $options['number'])) { $number = 5; } elseif ($number < 1) { $number = 1; } elseif ($number > 10) { $number = 10; } if (is_home()) { $offset = count($posts); } else { $offset = 0; } $r = new WP_Query("showposts={$number}&what_to_show=posts&nopaging=0&post_status=publish&offset={$offset}"); if ($r->have_posts()) { ?> <div id="recent"> <?php echo $before_title . $title . $after_title; ?> <ul> <?php while ($r->have_posts()) { $r->the_post(); ?> <li> <h4 class="recent-title"><a title="<?php _e('View this post', 'tarski'); ?> " href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <p class="recent-metadata"><?php echo the_time(get_option('date_format')); if (!get_tarski_option('hide_categories')) { _e(' in ', 'tarski'); the_category(', '); } ?> </p> <div class="recent-excerpt content"><?php the_excerpt(); ?> </div> </li> <?php } ?> </ul> </div> <!-- /recent --> <?php unset($r); wp_reset_query(); // Restore global post data stomped by the_post(). } wp_cache_add('tarski_recent_entries', ob_get_flush(), 'widget'); }
/** * tarski_post_categories_link() - Outputs post categories * * Categories list is nicely wrapped for potential DOM interactions * via JavaScript, CSS etc. * @since 2.0 * @return string */ function tarski_post_categories_link() { if (get_tarski_option('show_categories')) { printf(__(' in %s', 'tarski'), '<span class="categories">' . get_the_category_list(', ') . '</span>'); } }
/** * Add Tarski-specific classes to the body element. * * @since 3.0 * * @uses get_tarski_option * @uses is_valid_tarski_style * @uses get_bloginfo * * @param array $classes * @return array */ function tarski_body_class($classes) { if (get_tarski_option('centred_theme')) { $classes[] = 'centre'; } if (get_tarski_option('swap_sides')) { $classes[] = 'janus'; } if (get_tarski_option('style')) { $style = get_tarski_option('style'); $file = is_array($style) ? $style[1] : $style; if (is_valid_tarski_style($file)) { $classes[] = preg_replace('/^(.+)\\.css$/', '\\1', $file); } } if (get_bloginfo('text_direction') == 'rtl') { $classes[] = 'rtl'; } return $classes; }
<?php if (get_tarski_option('deleted')) { ?> <div class="updated fade below-h2"> <form action="<?php echo admin_url('admin-post.php?action=restore_tarski_options'); ?> " method="post"> <?php wp_nonce_field('admin_post_restore_tarski_options', '_wpnonce_restore_tarski_options'); ?> <input type="hidden" name="restore_options" value="1" /> <p><?php _e('You have deleted your Tarski options.', 'tarski'); ?> <input class="button" type="submit" name="submit" value="<?php _e('Restore Tarski Options »', 'tarski'); ?> " /></p> </form> </div> <?php }
<?php get_archives('monthly', '', 'html', '', '', 'TRUE'); ?> </ul> <?php th_postend(); ?> </div> <!-- /primary --> <?php } } ?> <div class="secondary"> <?php if (get_tarski_option('show_categories')) { ?> <h3><?php _e('Category Archives', 'tarski'); ?> </h3> <ul class="archivelist xoxo"> <?php wp_list_cats('sort_column=name&sort_order=desc'); ?> </ul> <?php } ?> <?php th_sidebar();
/** * tarski_blurb_wrapper() - Wraps footer blurb in div element. * * @deprecated 2.1 * @since 2.0 * @see tarski_footer_blurb() * @param string $blurb * @return string */ function tarski_blurb_wrapper($blurb) { _deprecated_function(__FUNCTION__, '2.1'); if (is_user_logged_in()) { $edit_link = sprintf('<p class="edit-link">(<a title="%1$s" id="edit-footer-blurb" href="%2$s">%3$s</a>)</p>' . "\n", __('Edit the footer content area'), get_bloginfo('wpurl') . '/wp-admin/themes.php?page=tarski-options#footer_blurb', __('edit', 'tarski')); } if (get_tarski_option('blurb')) { $blurb = "<div class=\"content\">\n{$blurb}</div>\n{$edit_link}"; $blurb = "<div id=\"blurb\">\n{$blurb}</div> <!-- /blurb -->\n"; } return $blurb; }
function widget($args, $instance) { global $posts; $cache = wp_cache_get('tarski_recent_entries', 'widget'); if (!is_array($cache)) { $cache = array(); } if (isset($cache[$args['widget_id']])) { echo $cache[$args['widget_id']]; return; } ob_start(); extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Articles', 'tarski') : $instance['title']); if (!($number = (int) $instance['number'])) { $number = 10; } else { if ($number < 1) { $number = 1; } else { if ($number > 15) { $number = 15; } } } $r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'offset' => is_home() ? count($posts) : 0)); if ($r->have_posts()) { ?> <?php echo $before_widget; ?> <?php if ($title) { echo $before_title . $title . $after_title; } ?> <ul> <?php while ($r->have_posts()) { $r->the_post(); ?> <li> <h4 class="recent-title"><a title="<?php _e('View this post', 'tarski'); ?> " href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <p class="recent-metadata"><?php printf(get_tarski_option('show_categories') ? __('%1$s in %2$s', 'tarski') : '%s', the_time(get_option('date_format')), get_the_category_list(', ', '', false)); ?> </p> <div class="recent-excerpt content"><?php the_excerpt(); ?> </div> </li> <?php } ?> </ul> <?php echo $after_widget; wp_reset_query(); // Restore global post data stomped by the_post(). } $cache[$args['widget_id']] = ob_get_flush(); wp_cache_add('tarski_recent_entries', $cache, 'widget'); }
/** * A simple wrapper around the get_the_category_list function, it wraps the * categories list in a span to make it easier to access via the DOM. * * @since 2.0 * * @uses get_tarski_option * @uses get_the_category_list * * @see tarski_post_metadata * * @param string $metadata * @return string */ function tarski_post_categories_link($metadata) { if (get_tarski_option('show_categories')) { $cats = get_the_category_list(', '); if (strlen($cats)) { $metadata .= sprintf(__(' in %s', 'tarski'), '<span class="categories">' . $cats . '</span>'); } } return $metadata; }
?> "><img class="header_image" alt="<?php echo $header_name; ?> " src="<?php echo get_bloginfo('template_directory') . '/headers/' . $header_image; ?> " /></label> <input id="header_<?php echo $header_name; ?> " name="header_image" value="<?php echo $header_name; ?> " type="radio"<?php if (get_tarski_option('header') == $header_name) { echo ' checked="checked"'; } ?> /> <?php } } } ?> <div class="clearer"></div> </div> <p><?php printf(__('Choose a header image by clicking on it. The current image is the %s one.', 'tarski'), '<span class="highlight">' . __('highlighted', 'tarski') . '</span>'); ?>