function arras_load_styles() { global $arras_registered_alt_layouts, $arras_registered_alt_styles; if (!defined('ARRAS_INHERIT_LAYOUT') || ARRAS_INHERIT_LAYOUT == true) { if (count($arras_registered_alt_layouts) > 0) { $layout = defined('ARRAS_FORCE_LAYOUT') ? ARRAS_FORCE_LAYOUT : arras_get_option('layout'); wp_enqueue_style('arras-layout', get_template_directory_uri() . '/css/layouts/' . $layout . '.css', false, '2011-12-12', 'all'); } } if (!defined('ARRAS_INHERIT_STYLES') || ARRAS_INHERIT_STYLES == true) { $scheme = arras_get_option('style'); if (!isset($scheme)) { $scheme = 'default'; } $css_path = '/css/styles/' . $scheme; if (is_rtl()) { $css_path .= '-rtl'; } wp_enqueue_style('arras', get_template_directory_uri() . $css_path . '.css', false, '2011-12-12', 'all'); } // add user css if (!ARRAS_CHILD) { wp_enqueue_style('arras-user', get_template_directory_uri() . '/user.css', false, '2011-12-12', 'all'); } else { if (is_rtl()) { wp_enqueue_style('arras-child', get_stylesheet_directory_uri() . '/rtl.css', false, '2011-12-12', 'all'); } else { wp_enqueue_style('arras-child', get_stylesheet_directory_uri() . '/style.css', false, '2011-12-12', 'all'); } } // load other custom styles do_action('arras_load_styles'); }
function featured_tab() { switch ($this->query_source) { case 'slideshow': $q = arras_parse_query(arras_get_option('slideshow_cat'), $this->postcount, 0, arras_get_option('slideshow_posttype'), arras_get_option('slideshow_tax')); break; case 'featured2': $q = arras_parse_query(arras_get_option('featured2_cat'), $this->postcount, 0, arras_get_option('featured2_posttype'), arras_get_option('featured2_tax')); break; default: $q = arras_parse_query(arras_get_option('featured1_cat'), $this->postcount, 0, arras_get_option('featured1_posttype'), arras_get_option('featured1_tax')); } $f = new WP_Query($q); if (!$f->have_posts()) { echo '<span class="textCenter sub">' . __('No posts at the moment. Check back again later!', 'arras') . '</span>'; } else { echo '<ul>'; while ($f->have_posts()) { $f->the_post(); ?> <li class="clearfix"> <?php if ($this->display_thumbs) { ?> <span class="thumb"><?php echo arras_get_thumbnail('sidebar-thumb'); ?> </span> <?php } ?> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a><br /> <span class="sub"><?php the_time(__('d F Y g:i A', 'arras')); ?> | <?php comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras')); ?> </span> </li> <?php } echo '</ul>'; } }
function arras_options_upgrade() { // If we've already done this, bail if (arras_get_option('updated')) { return; } $new_options = array(); $settings = arras_get_settings_data(); // Load our Arras 3 default settings foreach ($settings as $key => $value) { $new_options[$key] = $value[0]; } // See if we have any old options, $old_options = maybe_unserialize(get_option('arras_options')); if ('object' == gettype($old_options)) { // Arras 1.x stored tapestry info in a second place in the options table $old_tapestry_default = maybe_unserialize(get_option('arras_tapestry_default')); // Retrieve the old defaults into an array foreach ($old_options->defaults as $key => $value) { $new_options[$key] = $value; } // Now get the non-default settings (and overwrite the defaults for those that have been set) unset($old_options->defaults); // we're done with those foreach ($old_options as $key => $value) { $new_options[$key] = $value; } // Add the loose settings, too! if (is_array($old_tapestry_default)) { $new_options['nodes_per_row'] = $old_tapestry_default['nodes']; $new_options['nodes_excerpt'] = $old_tapestry_default['excerpt']; } // Check for renamed settings $new_names = array('logo' => 'site_logo', 'header_color' => 'header_background_color', 'facebook_profile' => 'facebook', 'twitter_username' => 'twitter', 'gplus_profile' => 'google', 'flickr_profile' => 'flickr', 'youtube_profile' => 'youtube'); foreach ($new_names as $old_name => $new_name) { if (array_key_exists($old_name, $new_options) && !empty($new_options[$old_name])) { $new_options[$new_name] = $new_options[$old_name]; } } } // One last pass to clean things up foreach ($new_options as $key => $value) { if (!array_key_exists($key, $settings)) { unset($new_options[$key]); } } // Write the translated options back to the database as Arras 3 options $new_options['updated'] = true; update_option('arras-options', $new_options); }
/** * Enqueue scripts */ function arras_scripts() { global $paged; // Slideshow scripts - only on first page of homepage and only if slideshow is enabled if (is_home() && !$paged && arras_get_option('enable_slideshow') !== false) { wp_enqueue_script('jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle2-min.js', array('jquery'), null, true); wp_enqueue_script('slideshow-settings', get_template_directory_uri() . '/js/slideshowsettings.js', array('jquery-cycle'), null, true); wp_enqueue_script('jquery-cycle-caption', get_template_directory_uri() . '/js/jquery.cycle2.caption2.min.js', array('slideshow-settings'), null, true); wp_enqueue_script('jquery-cycle-swipe', get_template_directory_uri() . '/js/jquery.cycle2.swipe.min.js', array('slideshow-settings'), null, true); } // Comment reply scripts - only on single pages if (is_singular()) { wp_enqueue_script('comment-reply'); } }
function get_video_posts($source = 'group', $format = 'post') { $output = ''; $num_of_videos = 12; switch ($source) { case 'channel': $vimeo_call = 'http://vimeo.com/api/v2/channel/tetaglobule/videos.json'; default: $vimeo_call = 'http://vimeo.com/api/v2/group/tetalab/videos.json'; } $response = wp_remote_get($vimeo_call, array('timeout' => 60)); if (!is_wp_error($response)) { $ret = json_decode($response["body"], true); for ($i = 0; $i < sizeof($ret) && $i < $num_of_videos; $i++) { $item = $ret[$i]; if (array_key_exists('title', $item) && array_key_exists('url', $item) && array_key_exists('upload_date', $item) && array_key_exists('user_name', $item) && array_key_exists('description', $item) && array_key_exists('thumbnail_medium', $item)) { switch ($format) { case 'rss': $output .= '<item><title>' . htmlspecialchars($item['title']) . '</title>'; $output .= '<link>' . $item['url'] . '</link>'; $output .= '<comments>' . $item['url'] . '#comment</comments>'; $output .= '<pubDate>' . convertVimeoTime($item['upload_date']) . '</pubDate>'; $output .= '<dc:creator>' . $item['user_name'] . '</dc:creator>'; $output .= '<guid isPermaLink="false">' . $item['url'] . '</guid>'; $output .= '<description><![CDATA[' . $item['description'] . ']]></description></item>'; break; default: $output .= '<li class="post hentry clearfix">'; $output .= '<div class="entry-thumbnails"><a class="entry-thumbnails-link" href="' . $item['url'] . '">'; $output .= '<img src="' . $item['thumbnail_medium'] . '" '; $output .= 'alt="' . htmlspecialchars($item['title']) . '" '; $output .= 'title="' . htmlspecialchars($item['title']) . '" width="200px" height="150px">'; $output .= '</a></div><h3 class="entry-title">'; $output .= '<a href="' . $item['url'] . '" rel="bookmark">'; $output .= htmlspecialchars($item['title']) . '</a></h3></li>'; break; } } else { $output .= '<p>Une erreur a eu lieu, pouvez-vous <a href="mailto:tetalab@lists.tetalab.org">contacter le tetalab</a> pour la signaler?</p>'; } } if ($format == 'post') { $output = '<ul class="hfeed posts-' . arras_get_option('featured_display') . ' clearfix">' . $output . '</ul>'; } } echo $output; }
/** * Register widgetized areas and update sidebar with default widgets. * @return null */ function arras_add_sidebars() { /* Default sidebars */ register_sidebar(array('name' => 'Primary Sidebar', 'id' => 'primary', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); register_sidebar(array('name' => 'Secondary Sidebar', 'id' => 'secondary', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); register_sidebar(array('name' => 'Bottom Content #1', 'id' => 'below-content-1', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); register_sidebar(array('name' => 'Bottom Content #2', 'id' => 'below-content-2', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); register_sidebar(array('name' => 'Header Widgets', 'id' => 'header-widgets', 'description' => 'A small widget area in the header. Use for small widgets', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); /* Footer sidebars (Up to 4 sidebars based on user preference) */ $footer_sidebars = arras_get_option('footer_columns'); if ($footer_sidebars == '') { $footer_sidebars = 1; } for ($i = 1; $i < $footer_sidebars + 1; $i++) { register_sidebar(array('name' => 'Footer Sidebar #' . $i, 'id' => 'footer-sidebar-' . $i, 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); } }
function featured_tab() { switch ($this->query_source) { case 'slideshow': $list = arras_get_option('slideshow_cat'); $post_type = arras_get_option('slideshow_posttype'); $taxonomy = arras_get_option('slideshow_tax'); break; case 'featured1': $list = arras_get_option('featured1_cat'); $post_type = arras_get_option('featured1_posttype'); $taxonomy = arras_get_option('featured1_tax'); break; case 'featured2': $list = arras_get_option('featured2_cat'); $post_type = arras_get_option('featured2_posttype'); $taxonomy = arras_get_option('featured2_tax'); break; default: $list = arras_get_option('news_cat'); $post_type = arras_get_option('news_posttype'); $taxonomy = arras_get_option('news_tax'); } arras_widgets_post_loop('sidebar-featured', array('list' => $list, 'taxonomy' => $taxonomy, 'show_thumbs' => $this->display_thumbs, 'show_excerpt' => false, 'query' => array('posts_per_page' => $this->postcount, 'post_type' => $post_type))); }
<th scope="row"><label for="arras-footer-title"><?php _e('Footer Title', 'arras'); ?> </label></th> <td> <?php echo arras_form_input(array('name' => 'arras-footer-title', 'id' => 'arras-footer-title', 'style' => 'width:40%', 'value' => arras_get_option('footer_title'))); ?> </td> </tr> <tr valign="top"> <th scope="row"><label for="arras-footer-message">Footer Message</label></th> <td> <?php echo arras_form_textarea('arras-footer-message', arras_get_option('footer_message'), 'style="width: 70%; height: 100px;" class="code"'); ?> <br /> <?php _e('Usually your website\'s copyright information would go here.<br /> It would be great if you could include a link to WordPress and even greater if you could include a link to the theme website. :)', 'arras'); ?> </td> </tr> </table> <?php do_action('arras_admin_settings-general'); ?> </div><!-- #general-settings -->
function arras_add_tapestry_default_thumbs() { $layout = arras_get_option('layout'); if (strpos($layout, '1c') !== false) { $size = array(215, 120); } else { if (strpos($layout, '3c') !== false) { $size = array(230, 130); } else { $size = array(195, 110); } } arras_add_image_size('node-based-thumb', __('Tapestry: Node-Based', 'arras'), $size[0], $size[1]); }
</label></th> <td> <?php echo arras_form_dropdown('arras-taxonomy-featured2', arras_get_taxonomy_list(arras_get_option('featured2_posttype')), arras_get_option('featured2_tax')); ?> </td> </tr> <tr valign="top"> <th scope="row"><label for="arras-taxonomy-news"><?php _e('News Posts', 'arras'); ?> </label></th> <td> <?php echo arras_form_dropdown('arras-taxonomy-news', arras_get_taxonomy_list(arras_get_option('news_posttype')), arras_get_option('news_tax')); ?> </td> </tr> </table> <?php do_action('arras_admin_taxonomy'); ?> <p><?php _e('<strong>Note:</strong> Custom taxonomies require the <code>query_var</code> parameter to be defined to work.', 'arras'); ?> </p>
?> <?php if (arras_get_option('news_title') != '') { ?> <h2 class="home-title"><?php _e(arras_get_option('news_title')); ?> </h2> <?php } ?> <div id="archive-posts"> <?php arras_render_posts(null, arras_get_option('default_tapestry') ? arras_get_option('default_tapestry') : 'quick'); ?> <div class="navigation clearfix"> <div class="floatleft"><?php next_posts_link(__('Older Entries', 'arras')); ?> </div> <div class="floatright"><?php previous_posts_link(__('Newer Entries', 'arras')); ?> </div> </div> </div><!-- #archive-posts --> <?php
?> </h1> <?php } else { ?> <h1 class="archive-title"><?php _e('Archives', 'arras'); ?> </h1> <?php } ?> <div id="archive-posts"> <?php arras_render_posts(null, arras_get_option('archive_display')); ?> <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <div class="navigation clearfix"> <div class="floatleft"><?php next_posts_link(__('Older Entries', 'arras')); ?> </div> <div class="floatright"><?php previous_posts_link(__('Newer Entries', 'arras'));
<div class="entry-content clearfix"> <?php the_content(__('<p>Read the rest of this entry »</p>', 'arras')); ?> <?php wp_link_pages(array('before' => __('<p><strong>Pages:</strong> ', 'arras'), 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> <?php arras_postfooter(); ?> <?php if (arras_get_option('display_author')) { arras_post_aboutauthor(); } ?> </div> <?php arras_below_post(); ?> <a name="comments"></a> <?php comments_template('', true); ?> <?php arras_below_comments(); ?>
</div><!-- #nav --> <?php arras_below_nav(); ?> <div id="main" class="clearfix"> <div id="container" class="clearfix"> <div id="content" class="section"> <?php arras_above_content(); ?> <?php if (arras_get_option('single_meta_pos') == 'bottom') { add_filter('arras_postfooter', 'arras_postmeta'); } else { add_filter('arras_postheader', 'arras_postmeta'); } ?> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php arras_above_post(); ?>
'name' => 'Bottom Content #1', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>' ) ); register_sidebar( array( 'name' => 'Bottom Content #2', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>' ) );*/ //Tehdään vaalit-kategorialle oma sidebar... register_sidebar(array('name' => 'Vaalit-kategorian sivupalkki', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); $footer_sidebars = arras_get_option('footer_sidebars'); if ($footer_sidebars == '') { $footer_sidebars = 1; } for ($i = 1; $i < $footer_sidebars + 1; $i++) { register_sidebar(array('name' => 'Footerin ' . $i . '. alapalkki', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); } // Header Actions if (!defined('ARRAS_INHERIT_STYLES') || ARRAS_INHERIT_STYLES == true) { add_action('arras_head', 'arras_add_style_css'); add_action('arras_custom_styles', 'arras_layout_styles'); } if (!defined('ARRAS_INHERIT_LAYOUT') || ARRAS_INHERIT_LAYOUT == true) { add_action('arras_head', 'arras_add_layout_css'); // Alternate Styles & Layouts register_alternate_layout('1c-fixed', __('1 Column Layout (No Sidebars)', 'arras'));
</label></th> <td> <?php echo arras_form_dropdown('arras-layout-index-newsdisplay', arras_get_tapestries_select(), arras_get_option('news_display')); ?> </td> </tr> <tr valign="top"> <th scope="row"><label for="arras-layout-index-count"><?php _e('News Count', 'arras'); ?> </label></th> <td> <?php echo arras_form_input(array('name' => 'arras-layout-index-count', 'id' => 'arras-layout-index-count', 'size' => '5', 'value' => arras_get_option('index_count'), 'maxlength' => 2)); ?> <?php _e('posts', 'arras'); ?> </td> </tr> </table> <?php do_action('arras_admin_settings-home'); ?> </div><!-- #layout -->
<h3><?php _e('Thumbnail Options', 'arras'); ?> </h3> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Auto Thumbnails', 'arras'); ?> </th> <td> <?php echo arras_form_checkbox('arras-thumbs-auto', 'show', arras_get_option('auto_thumbs'), 'id="arras-thumbs-auto"'); ?> <label for="arras-thumbs-auto"><?php _e('Check this to allow the theme to automatically retrieve the first attached image from the post as featured image when no image is specified.', 'arras'); ?> </label> </td> </tr> </table> <h3><?php _e('Thumbnail Sizes', 'arras'); ?> </h3>
/** * Sidebar setup function. * @since 1.6 */ function arras_add_sidebars() { /* Default sidebars */ register_sidebar(array('name' => 'Primary Sidebar', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); register_sidebar(array('name' => 'Secondary Sidebar #1', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); register_sidebar(array('name' => 'Bottom Content #1', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); register_sidebar(array('name' => 'Bottom Content #2', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); /* Footer sidebars (Up to 4 sidebars based on user preference) */ $footer_sidebars = arras_get_option('footer_sidebars'); if ($footer_sidebars == '') { $footer_sidebars = 1; } for ($i = 1; $i < $footer_sidebars + 1; $i++) { register_sidebar(array('name' => 'Footer Sidebar #' . $i, 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>')); } }
function arras_right_col() { global $forum_contributors, $translators; ?> <div id="arras-right-col"> <div class="postbox"> <h3><span><?php _e('Helpful Links', 'arras'); ?> </span></h3> <ul> <li><a href="http://www.arrastheme.com/wiki/doku.php/quick_start_guide"><?php _e('Quick Start Guide', 'arras'); ?> </a></li> <li><a href="http://www.arrastheme.com/forums/"><?php _e('Community Forums', 'arras'); ?> </a></li> <li><a href="http://arras-theme.googlecode.com/"><?php _e('Bug Tracker / Repository', 'arras'); ?> </a></li> </ul> </div> <div class="postbox"> <h3><span><?php _e('Recommended Plugins', 'arras'); ?> </span></h3> <ul> <li><a href="http://lesterchan.net/portfolio/programming/php/#wp-pagenavi">WP-PageNavi</a></li> <li><a href="http://blog.moskis.net/downloads/plugins/fancybox-for-wordpress/">FancyBox for WordPress</a></li> <li><a href="http://sexybookmarks.net/">SexyBookmarks</a></li> <li><a href="http://mitcho.com/code/yarpp/">Yet Another Related Posts Plugin</a></li> <li><a href="http://www.dev4press.com/plugins/gd-taxonomies-tools/">GD Custom Posts & Taxonomies Tools</a></li> </ul> </div> <?php if (!arras_get_option('donate')) { ?> <div class="postbox"> <h3><span><?php _e('How to Support?', 'arras'); ?> </span></h3> <p><?php _e('There are many ways you can support this theme:', 'arras'); ?> </p> <ul> <li><?php _e('Share other about the theme', 'arras'); ?> </li> <li><?php _e('Report bugs / Send patches', 'arras'); ?> </li> <li><?php _e('Contribute to the forums / wiki', 'arras'); ?> </li> <li><?php _e('Translate the theme', 'arras'); ?> </li> <li><strong><?php _e('Send in a donation!', 'arras'); ?> </strong></li> </ul> <p><a class="button-primary" href="http://www.arrastheme.com/donate/"><?php _e('Donate using PayPal', 'arras'); ?> </a></p> </div> <?php } ?> <?php if (!arras_get_option('donate')) { ?> <div class="postbox"> <h3><span><?php _e('Thanks!', 'arras'); ?> </span></h3> <p><?php _e('Many thanks to those who have contributed to the theme:', 'arras'); ?> </p> <p><strong><?php _e('Forum Contributors', 'arras'); ?> </strong><br /> <?php arras_get_contributors($forum_contributors); ?> </p> <p><strong><?php _e('Translators', 'arras'); ?> </strong><br /> <?php arras_get_contributors($translators); ?> </p> <div id="donors-list"> </div> </div> <?php } ?> <?php do_action('arras_admin_right_col'); ?> </div> <?php }
/** * Called to display post footer for news in single posts * @since 1.2.2 */ function arras_postfooter() { global $id, $post; $postfooter = ''; if (arras_get_option('post_tags') && !is_attachment() && is_array(get_the_tags())) { $postfooter .= '<div class="tags"><strong>' . __('Tags:', 'arras') . '</strong>' . get_the_tag_list(' ', ', ', ' ') . '</div>'; } echo apply_filters('arras_postfooter', $postfooter); }
} else { echo '<span class="grey">' . __('The developer of the child theme has disabled alternate stylesheets.', 'arras') . '</span>'; } ?> </td> </tr> <tr valign="top"> <th scope="row"><label for="arras-logo"><?php _e('Custom Logo', 'arras'); ?> </label></th> <td> <?php if (arras_get_option('logo') != 0) { echo wp_get_attachment_image(arras_get_option('logo'), 'full') . '<br />'; echo arras_form_checkbox('arras-delete-logo', 'show', false, 'id="arras-delete-logo"'); ?> <label for="arras-delete-logo"><?php _e('Delete existing', 'arras'); ?> </label> <?php } ?> <p id="arras-logo-field"><input type="file" id="arras-logo" name="arras-logo" size="35" /></p> </td> </tr> <tr valign="top">
function arras_widget_tabbed_sidebar($args) { global $wpdb; extract($args, EXTR_SKIP); $options = get_option('arras_widget_tabbed_sidebar'); $featured = arras_get_option('featured_cat'); ?> <li id="multi-sidebar-container"> <div id="multi-sidebar" class="clearfix"> <ul class="tabs clearfix"> <?php render_sidebar_tabs($options['order'], is_numeric($featured)); ?> </ul> <?php foreach ($options['order'] as $tab) { switch ($tab) { case 'featured': if (is_numeric($featured)) { ?> <div id="s-featured" class="widgetcontainer clearfix"> <ul> <?php $f = new WP_Query('showposts=5&cat=' . $featured); if (!$f->have_posts()) { ?> <span class="textCenter sub"><?php _e('No posts at the moment. Check back again later!', 'arras'); ?> </span> <?php } else { while ($f->have_posts()) { $f->the_post(); ?> <li><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a><br /> <span class="sub"><?php the_time(__('d F Y g:i A', 'arras')); ?> | <?php comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras')); ?> </span> </li> <?php } } ?> </ul> </div><!-- #s-featured --> <?php } break; case 'latest': ?> <div id="s-latest" class="widgetcontainer clearfix"> <ul> <?php $l = new WP_Query('showposts=5'); ?> <?php if (!$l->have_posts()) { ?> <span class="textCenter sub"><?php _e('No posts at the moment. Check back again later!', 'arras'); ?> </span> <?php } else { ?> <?php while ($l->have_posts()) { $l->the_post(); ?> <li><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a><br /> <span class="sub"><?php the_time(__('d F Y g:i A', 'arras')); ?> | <?php comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras')); ?> </span> </li> <?php } } ?> </ul> </div><!-- #s-latest --> <?php break; case 'comments': ?> <div id="s-comments" class="widgetcontainer clearfix"> <?php $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 8"); ?> <ul id="recentcomments"> <?php if ($comments) { foreach ($comments as $comment) { echo '<li class="recentcomments">' . sprintf(__('%1$s on %2$s', 'arras'), $comment->comment_author, '<a href="' . clean_url(get_comment_link($comment->comment_ID)) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>'; } } ?> </ul> </div><!-- #s-comments --> <?php break; case 'tags': ?> <div id="s-tags" class="widgetcontainer clearfix"> <?php wp_tag_cloud('smallest=8&largest=18'); ?> </div><!-- #s-tags --> <?php break; case 'popular': ?> <div id="s-popular" class="widgetcontainer clearfix"> <?php if (function_exists('akpc_most_popular')) { akpc_most_popular(); } ?> </div><!-- #s-popular --> <?php break; } } ?> </div><!-- #multi-sidebar --> </li><!-- #multi-sidebar-container --> <?php }
function arras_get_posts($page_type, $query = null) { global $post, $wp_query; if (!$query) { $query = $wp_query; } if ($query->have_posts()) { ?> <?php if (arras_get_option($page_type . '_display') == 'traditional') { ?> <div class="traditional hfeed"> <?php while ($query->have_posts()) { $query->the_post(); ?> <div <?php arras_single_post_class(); ?> > <?php arras_postheader(); ?> <div class="entry-content clearfix"><?php the_content(__('<p>Read the rest of this entry »</p>', 'arras')); ?> </div> <?php arras_postfooter(); ?> </div> <?php } ?> </div><!-- .traditional --> <?php } elseif (arras_get_option($page_type . '_display') == 'line') { ?> <ul class="hfeed posts-line clearfix"> <?php while ($query->have_posts()) { $query->the_post(); ?> <li <?php arras_post_class(); ?> > <?php if (!is_archive()) { ?> <span class="entry-cat"> <?php $cats = get_the_category(); if (arras_get_option('news_cat')) { echo $cats[1]->cat_name; } else { echo $cats[0]->cat_name; } ?> </span> <?php } ?> <h3 class="entry-title"><a rel="bookmark" href="<?php the_permalink(); ?> " title="<?php printf(__('Permalink to %s', 'arras'), get_the_title()); ?> "><?php the_title(); ?> </a></h3> <span class="entry-comments"><?php comments_number(); ?> </span> </li> <?php } ?> </ul> <?php } else { ?> <ul class="hfeed posts-<?php echo arras_get_option($page_type . '_display'); ?> clearfix"> <?php while ($query->have_posts()) { $query->the_post(); ?> <li <?php arras_post_class(); ?> > <?php arras_newsheader($page_type); ?> <div class="entry-summary"> <?php if (arras_get_option($page_type . '_display') == 'default') { //echo arras_strip_content(get_the_excerpt(), 20); echo get_the_excerpt(); } else { echo get_the_excerpt(); ?> <p class="quick-read-more"><a href="<?php the_permalink(); ?> " title="<?php printf(__('Permalink to %s', 'arras'), get_the_title()); ?> "> <?php _e('Read More', 'arras'); ?> </a></p> <?php } ?> </div> <?php arras_newsfooter($page_type); ?> </li> <?php } ?> </ul> <?php } ?> <?php } ?> <?php }
?> </dd> <?php } ?> </dl> </div> <h2 class="author-posts-title"><?php printf(__('Posts by %s', 'arras'), '<span class="vcard"><a class="url fn n" href="' . get_author_posts_url(get_the_author_meta('ID')) . '" title="' . esc_attr(get_the_author()) . '" rel="me">' . get_the_author_meta('display_name') . '</a></span>'); ?> </h2> <div id="archive-posts"> <?php arras_render_posts('author=' . get_the_author_meta('ID') . '&paged=' . $paged, arras_get_option('archive_display')); ?> </div> <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <div class="navigation clearfix"> <div class="floatleft"><?php next_posts_link(__('« Older Entries', 'arras')); ?> </div> <div class="floatright"><?php
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Sidebar #' . $i)) { ?> <li></li> <?php } ?> </ul> <?php } ?> </div> <div class="footer-message"> <p class="floatright"><a class="arras" href="http://arrastheme.net/"><strong><?php _e('About Arras WordPress Theme', 'arras'); ?> </strong></a></p> <?php echo stripslashes(arras_get_option('footer_message')); ?> </div><!-- .footer-message --> </div> </div><!-- #wrapper --> </div><!-- #page --> <?php arras_footer(); wp_footer(); ?> </body> </html>
} else { ?> <ul class="sf-menu menu clearfix"> <li><a href="<?php bloginfo('url'); ?> "><?php echo arras_get_option('topnav_home'); ?> </a></li> <?php if (arras_get_option('topnav_display') == 'pages') { wp_list_pages('sort_column=menu_order&title_li='); } else { if (arras_get_option('topnav_display') == 'linkcat') { wp_list_bookmarks('category=' . arras_get_option('topnav_linkcat') . '&hierarchical=0&show_private=1&hide_invisible=0&title_li=&categorize=0&orderby=id'); } else { wp_list_categories('number=11&hierarchical=1&orderby=id&hide_empty=1&title_li='); } } ?> </ul> <?php } ?> <ul class="rss clearfix"> <?php if ($feed == '') { ?> <li><a href="<?php bloginfo('rss2_url');
</td> </tr> <tr class="background-extras" valign="top" <?php if (arras_get_option('background_type') == 'original') { echo 'style="display: none"'; } ?> > <th scope="row"><label for="arras-background-color"><?php _e('Background Color', 'arras'); ?> </label></th> <td> <?php echo arras_form_input(array('name' => 'arras-background-color', 'id' => 'arras-background-color', 'class' => 'code', 'size' => '8', 'value' => arras_get_option('background_color'))); ?> <div id="colorpicker"></div> </td> </tr> </table> <p class="submit"> <input class="button-primary" type="submit" name="save" value="<?php _e('Save Changes', 'arras'); ?> " /> </p> </div><!-- #design -->
<br /> <?php echo arras_form_radio('arras-layout-metapos', 'bottom', arras_get_option('single_meta_pos') == 'bottom'); ?> <?php _e('After the Post Content', 'arras'); ?> <br /> </td> </tr> <tr valign="top"> <th scope="row"><label for="arras-single-custom-fields">Single Post Custom Fields</label></th> <td> <?php echo arras_form_textarea(array('name' => 'arras-single-custom-fields', 'id' => 'arras-single-custom-fields', 'class' => 'code', 'rows' => '3', 'cols' => '70', 'value' => stripslashes(arras_get_option('single_custom_fields')))); ?> <br /> </td> </tr> </table> <p class="submit"> <input class="button-primary" type="submit" name="save" value="<?php _e('Save Changes', 'arras'); ?> " /> <input type="hidden" name="action" value="save" /> </p>
<?php $backgrounds = array('default/bars.jpg' => 'background: #252221 url(' . get_bloginfo('template_url') . '/images/bg/' . arras_get_option('style') . '/bars.jpg) no-repeat top center', 'default/metallic.gif' => 'background: #252221 url(' . get_bloginfo('template_url') . '/images/bg/' . arras_get_option('style') . '/metallic.gif) repeat-x top center'); echo 'body { ' . $backgrounds[urldecode(arras_get_option('background'))] . '; }';
/** * Called to display post meta information in single posts (review scores, product information, etc.) * @since 1.2.2 */ function arras_postmeta($content) { global $post; $postmeta = ''; $custom_fields_list = arras_parse_single_custom_fields(); if ($custom_fields_list) { foreach ($custom_fields_list as $field_id => $field_name) { if ($field_value = get_post_meta($post->ID, $field_id, true)) { $postmeta .= '<div class="single-post-meta clearfix">'; $postmeta .= '<span class="single-post-meta-field single-post-meta-' . $field_id . '">' . $field_name . ':</span>'; $postmeta .= '<span class="single-post-meta-value single-post-meta-' . $field_id . '-value">' . $field_value . '</span>'; $postmeta .= '</div>'; } } } if (arras_get_option('single_meta_pos') == 'bottom') { return $postmeta . $content; } else { return $content . $postmeta; } }