/** * Helper function to grab and display thumbnail from specified post * @since 1.4.0 */ function ar2_get_thumbnail($size = 'thumbnail', $id = NULL, $attr = array()) { global $post, $ar2_image_sizes; if ($post) { $id = $post->ID; } if (!key_exists('alt', $attr)) { $attr['alt'] = esc_attr(get_the_excerpt()); } if (!key_exists('title', $attr)) { $attr['title'] = esc_attr(get_the_title()); } if (has_post_thumbnail($id)) { return get_the_post_thumbnail($id, $size, $attr); } else { // Could it be an attachment? if ($post->post_type == 'attachment') { return wp_get_attachment_image($id, $size, false, $attr); } // Use first thumbnail if auto thumbs is enabled. if (ar2_get_theme_option('auto_thumbs')) { $img_id = ar2_get_first_post_image_id(); if ($img_id) { return wp_get_attachment_image($img_id, $size, false, $attr); } } } // Return empty thumbnail if all else fails. return '<img src="' . get_template_directory_uri() . '/images/empty_thumbnail.gif" alt="' . $attr['alt'] . '" title="' . $attr['title'] . '" />'; }
/** * ar2_excerpt_length function. * @since 1.3 */ function ar2_excerpt_length($length) { if (!ar2_get_theme_option('excerpt_limit')) { $limit = 30; } else { $limit = ar2_get_theme_option('excerpt_limit'); } return $limit; }
/** * Renders single post's checkboxes fields. * @since 1.6 */ function ar2_render_single_form_field($args) { echo '<input type="hidden" value="0" name="ar2_theme_options[single_posts_display][post_author]" />'; echo ar2_form_checkbox('ar2_theme_options[single_posts_display][post_author]', 1, ar2_get_theme_option('post_display[post_author]')); ?> <label for="ar2_theme_options[single_posts_display][post_author]"><?php _e('Author & Publish Date', 'ar2'); ?> </label> <br /> <?php echo '<input type="hidden" value="0" name="ar2_theme_options[single_posts_display][excerpt]" />'; ?> <?php echo ar2_form_checkbox('ar2_theme_options[single_posts_display][excerpt]', 1, ar2_get_theme_option('post_display[excerpt]')); ?> <label for="ar2_theme_options[single_posts_display][excerpt]"><?php _e('Post Excerpt (if available)', 'ar2'); ?> </label> <br /> <?php echo '<input type="hidden" value="0" name="ar2_theme_options[single_posts_display][post_social]" />'; ?> <?php echo ar2_form_checkbox('ar2_theme_options[single_posts_display][post_social]', 1, ar2_get_theme_option('post_display[post_social]')); ?> <label for="ar2_theme_options[single_posts_display][post_social]"><?php _e('Facebook, Twitter, Google+ Buttons (English Only)', 'ar2'); ?> </label> <br /> <?php echo '<input type="hidden" value="0" name="ar2_theme_options[single_posts_display][post_cats]" />'; ?> <?php echo ar2_form_checkbox('ar2_theme_options[single_posts_display][post_cats]', 1, ar2_get_theme_option('post_display[post_cats]')); ?> <label for="ar2_theme_options[single_posts_display][post_cats]"><?php _e('Categories', 'ar2'); ?> </label> <br /> <?php echo '<input type="hidden" value="0" name="ar2_theme_options[single_posts_display][post_tags]" />'; ?> <?php echo ar2_form_checkbox('ar2_theme_options[single_posts_display][post_tags]', 1, ar2_get_theme_option('post_display[post_tags]')); ?> <label for="ar2_theme_options[single_posts_display][post_tags]"><?php _e('Tags', 'ar2'); ?> </label> <br /> <?php echo '<input type="hidden" value="0" name="ar2_theme_options[single_posts_display][single_thumbs]" />'; ?> <?php echo ar2_form_checkbox('ar2_theme_options[single_posts_display][single_thumbs]', 1, ar2_get_theme_option('post_display[single_thumbs]')); ?> <label for="ar2_theme_options[single_posts_display][single_thumbs]"><?php _e('Post Thumbnail', 'ar2'); ?> </label> <br /> <?php echo '<input type="hidden" value="0" name="ar2_theme_options[single_posts_display][display_author]" />'; ?> <?php echo ar2_form_checkbox('ar2_theme_options[single_posts_display][display_author]', 1, ar2_get_theme_option('post_display[display_author]')); ?> <label for="ar2_theme_options[single_posts_display][display_author]"><?php _e('Author Information', 'ar2'); ?> </label> <?php }
<span class="entry-comments"><?php echo get_comments_number(); ?> </span> </a> </div> <h3 class="entry-title"><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h3> <?php if (ar2_get_theme_option('nodebased_show_excerpts')) { ?> <abbr class="published"><?php printf(__('Posted %s', 'ar2'), ar2_posted_on(false)); ?> </abbr> <div class="entry-summary"><?php the_excerpt(); ?> </div> <?php } ?> </div>
?> </h1> <?php } else { ?> <h1 class="archive-title"><?php _e('Blog Archives', 'ar2'); ?> </h1> <?php } ?> <div id="archive-posts"> <?php ar2_render_posts(null, array('type' => ar2_get_theme_option('archive_display')), true); ?> </div><!-- #archive-posts --> <?php } else { ?> <?php ar2_post_notfound(); } ?> <?php ar2_below_content(); ?> </div><!-- #content -->
<footer class="entry-footer clearfix"> <?php if (ar2_get_theme_option('post_display[post_tags]') && is_array(get_the_tags())) { ?> <div class="entry-tags tags"> <?php the_tags('<strong>' . __('Tags: ', 'ar2') . '</strong>', ' '); ?> </div> <?php } ?> <?php if (ar2_get_theme_option('post_display[display_author]')) { ?> <?php $id = get_the_author_meta('ID'); ?> <div class="about-author clearfix"> <a class="author-avatar" href="<?php get_author_posts_url($id); ?> "><?php echo get_avatar($id, 64); ?> </a> <div class="author-meta"> <h4><?php
public function widget($args, $instance) { extract($args, EXTR_SKIP); $title = apply_filters('widget_title', $instance['title']); echo $before_widget; if ($title != '') { echo $before_title . $title . $after_title; } ?> <div class="social-nav clearfix"> <a class="rss" href="<?php echo get_feed_link('rss2'); ?> "><?php _e('RSS Feed', 'ar2'); ?> </a> <?php if ('' != ($twitter = ar2_get_theme_option('social_twitter'))) { ?> <a class="twitter" href="http://www.twitter.com/<?php echo $twitter; ?> "><?php _e('Twitter', 'ar2'); ?> </a> <?php } ?> <?php if ('' != ($facebook = ar2_get_theme_option('social_facebook'))) { ?> <a class="facebook" href="http://www.facebook.com/<?php echo $facebook; ?> "><?php _e('Facebook', 'ar2'); ?> </a> <?php } ?> <?php if ('' != ($gplus = ar2_get_theme_option('social_gplus'))) { ?> <a class="gplus" href="http://plus.google.com/<?php echo $gplus; ?> /posts"><?php _e('Google+', 'ar2'); ?> </a> <?php } ?> <?php if ('' != ($flickr = ar2_get_theme_option('social_flickr'))) { ?> <a class="flickr" href="http://www.flickr.com/photos/<?php echo $flickr; ?> "><?php _e('Flickr', 'ar2'); ?> </a> <?php } ?> <?php if ('' != ($youtube = ar2_get_theme_option('social_youtube'))) { ?> <a class="youtube" href="http://www.youtube.com/user/<?php echo $youtube; ?> "><?php _e('YouTube', 'ar2'); ?> </a> <?php } ?> </div> <?php echo $after_widget; }
function ar2_load_social_js() { if (ar2_get_theme_option('post_display[post_social]')) { wp_enqueue_script('addthis_js', 'http://s7.addthis.com/js/250/addthis_widget.js'); } }
</div> <?php } ?> </header><!-- .entry-header --> <div class="entry-content clearfix"> <?php the_content(__('Read the rest of this entry', 'ar2')); ?> </div> <footer class="entry-footer clearfix"> <?php if (ar2_get_theme_option('post_display[post_tags]') && is_array(get_the_tags())) { ?> <div class="entry-tags tags"> <?php the_tags('<strong>' . __('Tags: ', 'ar2') . '</strong>', ' '); ?> </div> <?php } ?> </footer><!-- .entry-footer --> </article>
/** * Overrides certain styles from the theme. * @since 1.6 */ public function override_styles() { ?> <!-- Generated by AR2 Theme --> <style type="text/css"> <?php foreach ($this->font_sets as $id => $args) { $font_id = ar2_get_theme_option('fonts[' . $id . ']'); if (isset($this->fonts[$font_id]) && $font_id != 'default') { echo $this->font_sets[$id]['selectors'] . ' { font-family: "' . $this->fonts[$font_id]['family'] . '", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; }' . "\n"; } } foreach ($this->color_sets as $id => $args) { $color = ar2_get_theme_option('colors[' . $id . ']'); if (isset($color) && $color != 'default') { if (isset($args['bg_selectors'])) { echo $args['bg_selectors'] . ' { background-color: ' . $color . '; }' . "\n"; } if (isset($args['text_selectors'])) { echo $args['text_selectors'] . ' { color: ' . $color . '; }' . "\n"; } if (isset($args['border_selectors'])) { echo $args['border_selectors'] . ' { border-color: ' . $color . '; }' . "\n"; } } } // override other styles do_action('ar2_custom_styles'); ?> </style> <?php }
</header><!-- .entry-header --> <div class="entry-content clearfix"> <?php the_content(__('<p>Read the rest of this entry »</p>', 'ar2')); ?> <?php wp_link_pages(array('before' => __('<p><strong>Pages:</strong> ', 'ar2'), 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> <footer class="entry-footer clearfix"> <?php if (ar2_get_theme_option('post_display[post_social]')) { ?> <div class="entry-social"> <div class="addthis_toolbox addthis_default_style"> <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_button_tweet"></a> <a class="addthis_button_google_plusone" g:plusone:size="medium"></a> <a class="addthis_counter addthis_pill_style"></a> </div> </div> <?php } ?> </footer><!-- .entry-footer --> </article>
if (get_the_author_meta('description') == '') { _e('No information is provided by the author.', 'ar2'); } else { the_author_meta('description'); } ?> </div> </div> </article> <h2 class="module-title"><?php printf(__('Posts by %s', 'ar2'), '<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 ar2_render_posts(null, array('type' => ar2_get_theme_option('archive_display'), 'query_args' => array('author' => get_the_author_meta('ID'))), true); ?> </div><!-- #archive-posts --> <?php ar2_below_content(); ?> </div><!-- #content --> <?php get_sidebar(); get_footer();
} ?> </div> <nav class="footer-meta"> <ul id="menu-top-menus-1" class="menu clearfix"> <?php wp_nav_menu(array('sort_column' => 'menu_order', 'menu_class' => 'menu clearfix', 'theme_location' => 'footer-nav', 'container' => false, 'fallback_cb' => 'ar2_footer_nav_fallback_cb', 'depth' => 1, 'items_wrap' => '%3$s')); ?> <li class="menu-item"><a href="#header"><strong><?php _e('Back to Top', 'ar2'); ?> </strong></a></li> </ul> <?php echo html_entity_decode(ar2_get_theme_option('footer_message')); ?> </nav><!-- .footer-meta --> </footer> </div><!-- #wrapper --> <?php wp_footer(); ?> </body> </html>