/**
  * Prints HTML with meta information for the current post-date/time and author.
  *
  * @since Sunspot 1.0
  */
 function sunspot_posted_on()
 {
     $options = sunspot_get_theme_options();
     $post_columns = $options['sunspot_radio_buttons'];
     if ('double' == $post_columns && is_front_page()) {
         printf(__('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a></span>', 'sunspot'), esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()));
     } else {
         printf(__('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="byline"> by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'sunspot'), esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'sunspot'), get_the_author())), esc_html(get_the_author()));
     }
 }
/**
 * Renders the radio options setting field.
 *
 * @since Sunspot 1.0
 */
function sunspot_settings_home_layout() {
	$options = sunspot_get_theme_options();

	foreach ( sunspot_radio_buttons() as $button ) {
	?>
	<div class="layout">
		<label class="description sunspot-label">
			<input type="radio" name="sunspot_theme_options[sunspot_radio_buttons]" value="<?php echo esc_attr( $button['value'] ); ?>" <?php checked( $options['sunspot_radio_buttons'], $button['value'] ); ?> />
			<span class="sunspot-layouts">
				<img src="<?php echo get_template_directory_uri(); ?>/inc/theme-options/images/<?php echo $button['value']; ?>.png"/>
				<?php echo $button['label']; ?>
			</span>
		</label>
	</div>
	<?php
	}
}
예제 #3
0
<?php

/**
 * The template for displaying the home page.
 *
 * @package WordPress
 * @subpackage Sunspot
 */
?>

<?php 
// Load either the single- or two-column post layout, depending on user's setting in the theme options
$options = sunspot_get_theme_options();
$post_columns = $options['sunspot_radio_buttons'];
if ($post_columns == 'double') {
    get_template_part('two-col-posts');
} else {
    get_template_part('index');
}