コード例 #1
0
 /**
  * Runs during core's after_setup_theme
  */
 public static function after_setup_theme()
 {
     global $content_width;
     self::$defaults = array('colors' => array('accent' => '#117bb8', 'text' => '#3a3a3a'), 'color_labels' => array('accent' => __('Accent Color', 'semicolon'), 'text' => __('Text Color', 'semicolon')));
     if (!isset($content_width)) {
         $content_width = 780;
     }
     add_action('init', array(__CLASS__, 'inline_controls_handler'));
     add_action('pre_get_posts', array(__CLASS__, 'pre_get_posts'));
     add_filter('posts_results', array(__CLASS__, 'posts_results'), 10, 2);
     add_filter('found_posts', array(__CLASS__, 'found_posts'), 10, 2);
     add_filter('body_class', array(__CLASS__, 'body_class'));
     add_filter('post_class', array(__CLASS__, 'post_class'), 10, 3);
     add_filter('shortcode_atts_gallery', array(__CLASS__, 'shortcode_atts_gallery'), 10, 3);
     add_filter('use_default_gallery_style', '__return_false');
     add_action('widgets_init', array(__CLASS__, 'widgets_init'));
     add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts'));
     add_action('wp', array(__CLASS__, 'setup_author'));
     add_filter('wp_page_menu_args', array(__CLASS__, 'page_menu_args'));
     add_filter('wp_title', array(__CLASS__, 'wp_title'), 10, 2);
     // Enhanced customizer support
     add_action('customize_register', array(__CLASS__, 'customize_register'));
     add_action('customize_preview_init', array(__CLASS__, 'customize_preview_js'));
     load_theme_textdomain('semicolon', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     // Editor style
     add_editor_style();
     // Post thumbnail support and additional image sizes.
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(360, 210, true);
     add_image_size('semicolon-mini', 60, 60, true);
     add_image_size('semicolon-gallery', 220, 220, true);
     // This theme uses a primary navigation menu and an additional
     // menu for social profile links.
     register_nav_menus(array('primary' => __('Primary Menu', 'semicolon'), 'social' => __('Social Menu', 'semicolon')));
     // Enable support for Post Formats.
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));
     // HTML5 support for core elements.
     add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery'));
     // Setup the WordPress core custom background feature.
     add_theme_support('custom-background', array('default-color' => 'ffffff', 'default-image' => ''));
     // Add support for Jetpack's Featured Content
     add_theme_support('featured-content', array('filter' => 'semicolon_get_featured_posts', 'max_posts' => 2));
     do_action('semicolon_after_setup_theme');
 }
コード例 #2
0
ファイル: index.php プロジェクト: zverush/semicolon
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 */
get_header();
?>

	<?php 
if (!is_front_page()) {
    ?>
	<?php 
    Semicolon::breadcrumbs();
    ?>
	<header class="page-header page-description">
		<h1 class="page-title">
			<?php 
    if (is_category()) {
        single_cat_title();
    } elseif (is_tag()) {
        printf(__('Tagged: %s', 'semicolon'), single_tag_title('', false));
    } elseif (is_author()) {
        printf(__('Author: %s', 'semicolon'), '<span class="vcard">' . get_the_author() . '</span>');
    } elseif (is_day()) {
        printf(__('Day: %s', 'semicolon'), '<span>' . get_the_date() . '</span>');
    } elseif (is_month()) {
        printf(__('Month: %s', 'semicolon'), '<span>' . get_the_date(_x('F Y', 'monthly archives date format', 'semicolon')) . '</span>');
    } elseif (is_year()) {
コード例 #3
0
ファイル: related-content.php プロジェクト: zverush/semicolon
<?php

/**
 */
do_action('semicolon_related_posts_before');
$related_posts = Semicolon::get_related_posts();
if ($related_posts->have_posts() && $related_posts->found_posts >= 2) {
    ?>
<div class="related-content">
	<h3 class="related-content-title"><?php 
    _e('Related posts', 'semicolon');
    ?>
</h3>

	<?php 
    while ($related_posts->have_posts()) {
        $related_posts->the_post();
        ?>

		<article id="post-<?php 
        the_ID();
        ?>
" class="hentry">
			<header class="entry-header">
				<a class="post-thumbnail" href="<?php 
        the_permalink();
        ?>
"><span><?php 
        the_post_thumbnail();
        ?>
</span></a>
コード例 #4
0
ファイル: content.php プロジェクト: zverush/semicolon
the_ID();
?>
" <?php 
post_class();
?>
>
	<header class="entry-header">
		<a class="post-thumbnail" href="<?php 
the_permalink();
?>
"><span><?php 
the_post_thumbnail();
?>
</span></a>
		<?php 
Semicolon::inline_controls();
?>

		<h1 class="entry-title"><a href="<?php 
the_permalink();
?>
" rel="bookmark"><?php 
the_title();
?>
</a></h1>

		<div class="entry-meta">
			<?php 
semicolon_posted_on();
?>
		</div><!-- .entry-meta -->