diff --git a/404.php b/404.php new file mode 100644 index 0000000..fc6e016 --- /dev/null +++ b/404.php @@ -0,0 +1,53 @@ + + + + +
+ + +
+

+ +

+ + +
+

+

+ +

+

+ +

+

+ +

+
+ +
+ +
+
+ + diff --git a/archive.php b/archive.php new file mode 100644 index 0000000..5c33952 --- /dev/null +++ b/archive.php @@ -0,0 +1,47 @@ + + + + +
+ +
+ + ' . get_the_date() . '' ); ?> + + ' . get_the_date( __( 'F Y', 'atticus-finch' ) ) . '' ); ?> + + ' . get_the_date( 'Y' ) . '' ); ?> + + + +
+ + + + + + + + + + + + +
+
+ + diff --git a/category.php b/category.php new file mode 100644 index 0000000..ee2d1fc --- /dev/null +++ b/category.php @@ -0,0 +1,44 @@ + + + + +
+ +
+

+ %s” category:', 'atticus-finch' ), single_cat_title( '', false ) ); + ?> +

+ +
+ + + + + + + + + + + + +
+
+ + diff --git a/comments.php b/comments.php new file mode 100644 index 0000000..72fb9bb --- /dev/null +++ b/comments.php @@ -0,0 +1,75 @@ +
+ + + +This post is password protected. Enter the password to view comments.

'; + return; + } +?> + + +

+ 'comment','post_id' => $post->ID)) ); + printf( _nx( 'One comment on “%2$s”', '%1$s comments on “%2$s”', $post_comments, 'comments title', 'atticus-finch' ), + number_format_i18n( $post_comments ), '' . get_the_title() . '' ); + ?> +

+
    + 'div', + 'short_ping' => false, + 'avatar_size' => 32, + 'type' => 'comment', + 'format' => 'xhtml', + ) ); + ?> +
+ + +

+ 'pings', 'post_id' => $post->ID )) ); + if ( $post_pings > 0 ) { + printf( _nx( 'One pingback/trackback on “%2$s”', '%1$s pingbacks/trackbacks on “%2$s”', $post_pings, 'pingbacks title', 'atticus-finch' ), + number_format_i18n( $post_pings ), '' . get_the_title() . '' ); + } + ?> +

+
    + 'div', + 'short_ping' => true, + 'avatar_size' => 0, + 'type' => 'pings', + 'format' => 'xhtml', + ) ); + ?> +
+ + 1 && get_option( 'page_comments' ) ) : + ?> + + + + +

+ + + + + + + + +
\ No newline at end of file diff --git a/comments__.php b/comments__.php new file mode 100644 index 0000000..871bfa8 --- /dev/null +++ b/comments__.php @@ -0,0 +1,80 @@ + + +
+ + + + +

+ ' . get_the_title() . '' + ); + ?> +

+ + 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> + + + +
    + 'ol', + 'short_ping' => true, + ) ); + ?> +
+ + 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> + + + + + + +

+ + + + +
diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..b23560a --- /dev/null +++ b/footer.php @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + diff --git a/formats/content-aside.php b/formats/content-aside.php new file mode 100644 index 0000000..e3e89a3 --- /dev/null +++ b/formats/content-aside.php @@ -0,0 +1,20 @@ + +
> + + + + + + +

+ + + + +

+ + +

+ + + diff --git a/formats/content-audio.php b/formats/content-audio.php new file mode 100644 index 0000000..584fa0e --- /dev/null +++ b/formats/content-audio.php @@ -0,0 +1,19 @@ + +
> + + + + + +

+ '; + } else { + echo ''; + } + ?> + +

+ + diff --git a/formats/content-chat.php b/formats/content-chat.php new file mode 100644 index 0000000..4819293 --- /dev/null +++ b/formats/content-chat.php @@ -0,0 +1,19 @@ + +
> + + + + + +

+ '; + } else { + echo ''; + } + ?> + +

+ + diff --git a/formats/content-gallery.php b/formats/content-gallery.php new file mode 100644 index 0000000..ba7c028 --- /dev/null +++ b/formats/content-gallery.php @@ -0,0 +1,19 @@ + +
> + + + + + +

+ '; + } else { + echo ''; + } + ?> + +

+ + diff --git a/formats/content-image.php b/formats/content-image.php new file mode 100644 index 0000000..d6d0ab8 --- /dev/null +++ b/formats/content-image.php @@ -0,0 +1,19 @@ + +
> + + + + + +

+ '; + } else { + echo ''; + } + ?> + +

+ + diff --git a/formats/content-link.php b/formats/content-link.php new file mode 100644 index 0000000..492f6cf --- /dev/null +++ b/formats/content-link.php @@ -0,0 +1,20 @@ + +
> + + + + + + +

+ + + + +

+ + +

+ + + diff --git a/formats/content-quote.php b/formats/content-quote.php new file mode 100644 index 0000000..798bdc2 --- /dev/null +++ b/formats/content-quote.php @@ -0,0 +1,21 @@ + +
> + + + + + + +

+ + + + + +

+ + +

+ + + diff --git a/formats/content-status.php b/formats/content-status.php new file mode 100644 index 0000000..ee78cc3 --- /dev/null +++ b/formats/content-status.php @@ -0,0 +1,20 @@ + +
> + + + + + + +

+ + + + +

+ + +

+ + + diff --git a/formats/content-video.php b/formats/content-video.php new file mode 100644 index 0000000..b92fe2c --- /dev/null +++ b/formats/content-video.php @@ -0,0 +1,19 @@ + +
> + + + + + +

+ '; + } else { + echo ''; + } + ?> + +

+ + diff --git a/formats/content.php b/formats/content.php new file mode 100644 index 0000000..a921202 --- /dev/null +++ b/formats/content.php @@ -0,0 +1,20 @@ + +
> + + + + + + +

+ '; + } else { + echo ''; + } + ?> + +

+ + diff --git a/formats/excerpt-aside.php b/formats/excerpt-aside.php new file mode 100644 index 0000000..623dc5f --- /dev/null +++ b/formats/excerpt-aside.php @@ -0,0 +1,42 @@ + +
> + + + + +

+ + + + +

+ + +
+ + +
+

+ + + + + + +
+ +
+ + + +
diff --git a/formats/excerpt-audio.php b/formats/excerpt-audio.php new file mode 100644 index 0000000..0980eb6 --- /dev/null +++ b/formats/excerpt-audio.php @@ -0,0 +1,36 @@ + +
> + + + +

+ + '; + } else { + echo ''; + } + ?> + + +

+ + +
+ + + + + +
+ +
+ + + +
diff --git a/formats/excerpt-chat.php b/formats/excerpt-chat.php new file mode 100644 index 0000000..0a8c3f1 --- /dev/null +++ b/formats/excerpt-chat.php @@ -0,0 +1,36 @@ + +
> + + + +

+ + '; + } else { + echo ''; + } + ?> + + +

+ + +
+ + + + + +
+ +
+ + + +
diff --git a/formats/excerpt-gallery.php b/formats/excerpt-gallery.php new file mode 100644 index 0000000..3a2cb95 --- /dev/null +++ b/formats/excerpt-gallery.php @@ -0,0 +1,36 @@ + +
> + + + +

+ + '; + } else { + echo ''; + } + ?> + + +

+ + +
+ + + + + +
+ +
+ + + +
diff --git a/formats/excerpt-image.php b/formats/excerpt-image.php new file mode 100644 index 0000000..8ac4cc3 --- /dev/null +++ b/formats/excerpt-image.php @@ -0,0 +1,36 @@ + +
> + + + +

+ + '; + } else { + echo ''; + } + ?> + + +

+ + +
+ + + + + +
+ +
+ + + +
diff --git a/formats/excerpt-link.php b/formats/excerpt-link.php new file mode 100644 index 0000000..98871cc --- /dev/null +++ b/formats/excerpt-link.php @@ -0,0 +1,42 @@ + +
> + + + + +

+ + + + +

+ + +
+ + +
+

+ + + + + + +
+ +
+ + + +
diff --git a/formats/excerpt-quote.php b/formats/excerpt-quote.php new file mode 100644 index 0000000..067770e --- /dev/null +++ b/formats/excerpt-quote.php @@ -0,0 +1,43 @@ + +
> + + + + +

+ + + + + +

+ + +
+ + +
+

+ + + + + + +
+ +
+ + + +
diff --git a/formats/excerpt-status.php b/formats/excerpt-status.php new file mode 100644 index 0000000..b64f42b --- /dev/null +++ b/formats/excerpt-status.php @@ -0,0 +1,42 @@ + +
> + + + + +

+ + + + +

+ + +
+ + +
+

+ + + + + + +
+ +
+ + + +
diff --git a/formats/excerpt-video.php b/formats/excerpt-video.php new file mode 100644 index 0000000..2214333 --- /dev/null +++ b/formats/excerpt-video.php @@ -0,0 +1,36 @@ + +
> + + + +

+ + '; + } else { + echo ''; + } + ?> + + +

+ + +
+ + + + + +
+ +
+ + + +
diff --git a/formats/excerpt.php b/formats/excerpt.php new file mode 100644 index 0000000..87d52c9 --- /dev/null +++ b/formats/excerpt.php @@ -0,0 +1,36 @@ + +
> + + + +

+ + '; + } else { + echo ''; + } + ?> + + +

+ + +
+ + + + + +
+ +
+ + + +
diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..55f2f37 --- /dev/null +++ b/functions.php @@ -0,0 +1,184 @@ + tag in the document head, and expect WordPress to + * provide it for us. + */ + add_theme_support( 'title-tag' ); + + /* + * Enable support for Post Thumbnails on posts and pages. + * + * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails + */ + add_theme_support( 'post-thumbnails' ); + + // This theme uses wp_nav_menu() in three locations. + register_nav_menus( array( + 'top-menu' => esc_html__( 'Top Menu', 'atticus-finch' ), + 'primary-menu' => esc_html__( 'Primary Menu', 'atticus-finch' ), + 'footer-menu' => esc_html__( 'Footer Menu', 'atticus-finch' ), + ) ); + + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( 'html5', array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) ); + + /* + * Enable support for Post Formats. + * See http://codex.wordpress.org/Post_Formats + */ + add_theme_support( 'post-formats', array( + 'aside', + 'audio', + 'chat', + 'gallery', + 'image', + 'link', + 'quote', + 'status', + 'video', + ) ); + + // Set up the WordPress core custom background feature. + add_theme_support( 'custom-background', apply_filters( 'atticus_finch_custom_background_args', array( + 'default-color' => 'ffffff', + 'default-image' => '', + ) ) ); +} +endif; // atticus_finch_setup +add_action( 'after_setup_theme', 'atticus_finch_setup' ); + +/** + * Set the content width in pixels, based on the theme's design and stylesheet. + * + * Priority 0 to make it available to lower priority callbacks. + * + * @global int $content_width + */ +function atticus_finch_content_width() { + $GLOBALS['content_width'] = apply_filters( 'atticus_finch_content_width', 620 ); +} +add_action( 'after_setup_theme', 'atticus_finch_content_width', 0 ); + +/** + * Register widget area. + * + * @link http://codex.wordpress.org/Function_Reference/register_sidebar + */ +function atticus_finch_widgets_init() { + register_sidebar( array( + 'name' => esc_html__( 'Sidebar', 'atticus-finch' ), + 'id' => 'sidebar-1', + 'description' => '', + 'before_widget' => '', + 'after_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); +} +add_action( 'widgets_init', 'atticus_finch_widgets_init' ); + +/** + * Enqueue scripts and styles. + */ +function atticus_finch_scripts() { + wp_enqueue_style( 'atticus-finch-style', get_stylesheet_uri(), array (), '0.3', 'screen' ); + + wp_enqueue_style( 'atticus-finch-googlefont', 'http://fonts.googleapis.com/css?family=IM+Fell+English:400,400italic', 'atticus-finch-style', '0.4', 'all' ); + + wp_enqueue_style( 'atticus-finch-fa', 'http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css', 'atticus-finch-style', '0.4', 'all' ); + + wp_enqueue_style( 'atticus-finch-mobile', get_stylesheet_directory_uri() . '/styles/mobile.css', 'atticus-finch-style', '0.4', 'handheld' ); + + wp_enqueue_style( 'atticus-finch-print', get_stylesheet_directory_uri() . '/styles/print.css', 'atticus-finch-style', '0.4', 'print' ); + + wp_enqueue_style( 'atticus-finch-menu-style', get_template_directory_uri() . '/styles/superfish.css', 'atticus-finch-style', '0.4', 'screen' ); + + wp_enqueue_script( 'atticus-finch-navigation', get_template_directory_uri() . '/js/superfish.js', array(), '0.4', true ); + + wp_enqueue_script( 'atticus-finch-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '0.4', true ); + + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } +} +add_action( 'wp_enqueue_scripts', 'atticus_finch_scripts' ); + +/** + * Enable live changes in the customizer + */ +function atticus_finch_customizer_script() { + wp_enqueue_script( 'atticus-finch-theme-customizer', get_template_directory_uri() . '/js/customizer.js', array(), '0.4', true ); +} +add_action( 'customize_preview_init', 'atticus_finch_customizer_script' ); + + +// Change "read more" link on excerpts +// codex.wordpress.org/Function_Reference/the_excerpt +function atticus_finch_excerpt_more( $more ) { + $text = get_theme_mod( 'atticus_finch_readmore', '…read more…' ); + return ' ' . $text . ''; +} +add_filter( 'excerpt_more', 'atticus_finch_excerpt_more' ); + + +/** + * Implement the Custom Header feature. + */ +require get_template_directory() . '/functions/custom-header.php'; + +/** + * Custom template tags for this theme. + */ +require get_template_directory() . '/functions/template-tags.php'; + +/** + * Customizer additions. + */ +require get_template_directory() . '/functions/customizer.php'; + +/** + * Load Jetpack compatibility file. + */ +require get_template_directory() . '/functions/jetpack.php'; + +/** + * Add our widget areas. + */ +require get_template_directory() . '/functions/widget-areas.php'; diff --git a/functions/custom-header.php b/functions/custom-header.php new file mode 100644 index 0000000..7525653 --- /dev/null +++ b/functions/custom-header.php @@ -0,0 +1,126 @@ + + + + + + * + * @package Atticus Finch + */ + +/** + * Set up the WordPress core custom header feature. + * + * @uses atticus_finch_header_style() + * @uses atticus_finch_admin_header_style() + * @uses atticus_finch_admin_header_image() + */ +function atticus_finch_custom_header_setup() { + add_theme_support( 'custom-header', apply_filters( 'atticus_finch_custom_header_args', array( + 'default-image' => '', + 'default-text-color' => '000000', + 'width' => 1000, + 'height' => 250, + 'flex-height' => true, + 'wp-head-callback' => 'atticus_finch_header_style', + 'admin-head-callback' => 'atticus_finch_admin_header_style', + 'admin-preview-callback' => 'atticus_finch_admin_header_image', + ) ) ); +} +add_action( 'after_setup_theme', 'atticus_finch_custom_header_setup' ); + +if ( ! function_exists( 'atticus_finch_header_style' ) ) : +/** + * Styles the header image and text displayed on the blog + * + * @see atticus_finch_custom_header_setup(). + */ +function atticus_finch_header_style() { + $header_text_color = get_header_textcolor(); + + // If no custom options for text are set, let's bail + // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value. + if ( HEADER_TEXTCOLOR == $header_text_color ) { + return; + } + + // If we get this far, we have custom styles. Let's do this. + ?> + + Header admin panel. + * + * @see atticus_finch_custom_header_setup(). + */ +function atticus_finch_admin_header_style() { +?> + + Header admin panel. + * + * @see atticus_finch_custom_header_setup(). + */ +function atticus_finch_admin_header_image() { +?> +
+

+ +

+
+ + + +
+get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + + +$wp_customize->add_panel( 'atticusfinch', array( + 'title' => __( 'Atticus Finch Theme Options', 'atticus-finch' ), + 'description' => __( 'The Atticus Finch theme has many options. Vist the theme\'s home page for complete instructions.', 'atticus-finch' ), + 'priority' => 05, +) ); + + +// Widget Areas + $wp_customize->add_section( 'atticus_finch_widget_areas', array( + 'title' => __( 'Widget Areas', 'atticus-finch' ), + 'capability' => 'edit_theme_options', + 'priority' => 30, + 'description' => __( 'Select which action hook widget areas you would like to activate.', 'atticus-finch' ), + 'panel' => 'atticusfinch', + ) ); + + + $wp_customize->add_setting( 'atticus_finch_before_header', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_before_header', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Header', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_after_top_menu', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_after_top_menu', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'After Top Menu', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_before_social_media', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_before_social_media', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Social Media', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_before_primary_menu', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_before_primary_menu', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Primary Menu', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_after_header', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_after_header', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'After Header', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_container_top', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_container_top', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Top of Container', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_before_post_title', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_before_post_title', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Post Title', 'atticus-finch' ), + ) ); + +/* + * We've removed this action hook, but let's leave this control in place + * in case we find a use for it later. + $wp_customize->add_setting( 'atticus_finch_before_post_content', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_before_post_content', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Post Content', 'atticus-finch' ), + ) ); +*/ + + + $wp_customize->add_setting( 'atticus_finch_post_top', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_post_top', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Top of Post', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_post_bottom', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_post_bottom', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Bottom of Post', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_after_post_content', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_after_post_content', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'After Post Content', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_before_post_meta', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_before_post_meta', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Post Meta', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_after_post_meta', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_after_post_meta', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'After Post Meta', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_before_comments', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_before_comments', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Comments', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_after_comments', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_after_comments', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'After Comments', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_before_comment_form', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_before_comment_form', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Comment Form', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_after_comment_form', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_after_comment_form', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'After Comment Form', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_container_bottom', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_container_bottom', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Bottom of Container', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_before_footer_menu', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_before_footer_menu', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Footer Menu', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_footer_top', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_footer_top', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Top of Footer', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_footer_bottom', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_footer_bottom', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Bottom of Footer', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_after_footer', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_after_footer', array( + 'section' => 'atticus_finch_widget_areas', + 'type' => 'checkbox', + 'label' => __( 'Before Footer', 'atticus-finch' ), + ) ); + + +// Post Format Title Options + $wp_customize->add_section( 'atticus_finch_post_format_title_options', array( + 'title' => __( 'Post Format Title Options', 'atticus-finch' ), + 'capability' => 'edit_theme_options', + 'priority' => 10, + 'description' => __('Select whether titles should appear for various post formats.', 'atticus-finch'), + 'panel' => 'atticusfinch', + ) ); + + $wp_customize->add_setting( 'atticus_finch_aside_title', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_aside_title', array( + 'section' => 'atticus_finch_post_format_title_options', + 'type' => 'checkbox', + 'label' => __( 'Display title for asides', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_link_title', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_link_title', array( + 'section' => 'atticus_finch_post_format_title_options', + 'type' => 'checkbox', + 'label' => __( 'Display title for links', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_quote_title', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_quote_title', array( + 'section' => 'atticus_finch_post_format_title_options', + 'type' => 'checkbox', + 'label' => __( 'Display title for quotes', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_status_title', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_status_title', array( + 'section' => 'atticus_finch_post_format_title_options', + 'type' => 'checkbox', + 'label' => __( 'Display title for statuses', 'atticus-finch' ), + ) ); + + +// Post Format Excerpt Options + $wp_customize->add_section( 'atticus_finch_post_format_excerpt_options', array( + 'title' => __( 'Post Format Excerpt Options', 'atticus-finch' ), + 'capability' => 'edit_theme_options', + 'priority' => 20, + 'description' => __('By default, the aside, link, quote, and statu post format will display full content on the home page. You can choose to show excerpts instead.', 'atticus-finch'), + 'panel' => 'atticusfinch', + ) ); + + $wp_customize->add_setting( 'atticus_finch_aside_excerpt', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_aside_excerpt', array( + 'section' => 'atticus_finch_post_format_excerpt_options', + 'type' => 'checkbox', + 'label' => __( 'Display excerpt for asides', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_link_excerpt', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_link_excerpt', array( + 'section' => 'atticus_finch_post_format_excerpt_options', + 'type' => 'checkbox', + 'label' => __( 'Display excerpt for links', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_quote_excerpt', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_quote_excerpt', array( + 'section' => 'atticus_finch_post_format_excerpt_options', + 'type' => 'checkbox', + 'label' => __( 'Display excerpt for quotes', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_status_excerpt', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_status_excerpt', array( + 'section' => 'atticus_finch_post_format_excerpt_options', + 'type' => 'checkbox', + 'label' => __( 'Display excerpt for statuses', 'atticus-finch' ), + ) ); + + + $default_readmore = __( '…read more…', 'atticus-finch' ); + $wp_customize->add_setting( 'atticus_finch_readmore', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'default' => $default_readmore, + 'sanitize_callback' => 'atticus_finch_sanitize_text', + ) ); + + $wp_customize->add_control( 'atticus_finch_readmore', array( + 'section' => 'atticus_finch_post_format_excerpt_options', + 'type' => 'text', + 'label' => __( 'Text for ‘read more’ link (in all excerpts)', 'atticus-finch'), + ) ); + + +// Copyright Information + $wp_customize->add_section( 'atticus_finch_copyright', array( + 'title' => __( 'Copyright Information', 'atticus-finch' ), + 'capability' => 'edit_theme_options', + 'priority' => 50, + 'description' => __( 'Copyright information will appear in the footer, and at the bottom of printed pages. (Make sure you have not disabled this function under "Miscellaneous Options")', 'atticus-finch' ), + 'panel' => 'atticusfinch', + ) ); + + $wp_customize->add_setting( 'atticus_finch_copyright', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize' => 'html', + ) ); + +$default_copyright = 'Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.'; + + $wp_customize->add_control( 'atticus_finch_copyright', array( + 'section' => 'atticus_finch_copyright', + 'default' => $default_copyright, + 'type' => 'textarea', + 'label' => __( 'Enter your copyright information. (HTML is allowed.)', 'atticus-finch' ), + ) ); + + +// Custom CSS Information + $wp_customize->add_section( 'atticus_finch_custom_css', array( + 'title' => __( 'Custom CSS', 'atticus-finch' ), + 'capability' => 'edit_theme_options', + 'priority' => 60, + 'description' => __( 'Custom CSS is appended to the <head> of your document. If you need to enter more than a few lines, use a child theme.', 'atticus-finch' ), + 'panel' => 'atticusfinch', + ) ); + + $wp_customize->add_setting( 'atticus_finch_ccss', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_css', + ) ); + + + $wp_customize->add_control( 'atticus_finch_ccss', array( + 'section' => 'atticus_finch_custom_css', + 'default' => '', + 'type' => 'textarea', + 'label' => __( 'Enter custom CSS here', 'atticus-finch' ), + ) ); + + +// Print Options + $wp_customize->add_section( 'atticus_finch_print', array ( + 'title' => __( 'Print Options', 'atticus-finch' ), + 'capability' => 'edit_theme_options', + 'priority' => 40, + 'panel' => 'atticusfinch', + ) ); + + + $wp_customize->add_setting( 'atticus_finch_print_url', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_print_url', array( + 'section' => 'atticus_finch_print', + 'type' => 'checkbox', + 'label' => __( 'Print URL information at end of post', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_print_copyright', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_print_copyright', array( + 'section' => 'atticus_finch_print', + 'type' => 'checkbox', + 'label' => __( 'Print copyright information at end of post', 'atticus-finch' ), + ) ); + + +// Social Media Options + $wp_customize->add_section( 'atticus_finch_social_media', array( + 'title' => __( 'Social Media Options', 'atticus-finch' ), + 'capability' => 'edit_theme_options', + 'priority' => 90, + 'panel' => 'atticusfinch', + ) ); + + $wp_customize->add_setting( 'atticus_finch_rss', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanintize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_rss', array( + 'section' => 'atticus_finch_social_media', + 'type' => 'checkbox', + 'label' => __( 'Display link to RSS feed', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_twitter2', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize' => 'html', + ) ); + + $wp_customize->add_control( 'atticus_finch_twitter2', array( + 'section' => 'atticus_finch_social_media', + 'type' => 'text', + 'label' => __( 'Enter second Twitter URL', 'atticus-finch'), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_twitter', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize' => 'html', + ) ); + + $wp_customize->add_control( 'atticus_finch_twitter', array( + 'section' => 'atticus_finch_social_media', + 'type' => 'text', + 'label' => __( 'Enter Twitter URL', 'atticus-finch'), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_facebook', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize' => 'html', + ) ); + + $wp_customize->add_control( 'atticus_finch_facebook', array( + 'section' => 'atticus_finch_social_media', + 'type' => 'text', + 'label' => __( 'Enter Facebook URL', 'atticus-finch'), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_instagram', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize' => 'html', + ) ); + + $wp_customize->add_control( 'atticus_finch_instagram', array( + 'section' => 'atticus_finch_social_media', + 'type' => 'text', + 'label' => __( 'Enter Instagram URL', 'atticus-finch'), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_youtube', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize' => 'html', + ) ); + + $wp_customize->add_control( 'atticus_finch_youtube', array( + 'section' => 'atticus_finch_social_media', + 'type' => 'text', + 'label' => __( 'Enter YouTube URL', 'atticus-finch'), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_pinterest', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize' => 'html', + ) ); + + $wp_customize->add_control( 'atticus_finch_pinterest', array( + 'section' => 'atticus_finch_social_media', + 'type' => 'text', + 'label' => __( 'Enter Pinterest Profile URL', 'atticus-finch'), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_amazon', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'sanitize' => 'html', + ) ); + + $wp_customize->add_control( 'atticus_finch_amazon', array( + 'section' => 'atticus_finch_social_media', + 'type' => 'text', + 'label' => __( 'Enter Amazon Wish List URL', 'atticus-finch'), + ) ); + + +// Miscellaneous Options + $wp_customize->add_section( 'atticus_finch_misc', array( + 'title' => __( 'Miscellaneous Options', 'atticus-finch' ), + 'capability' => 'edit_theme_options', + 'priority' => 100, + 'panel' => 'atticusfinch', + ) ); + + $wp_customize->add_setting( 'atticus_finch_display_copyright', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'default' => '1', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_display_copyright', array( + 'section' => 'atticus_finch_misc', + 'type' => 'checkbox', + 'label' => __( 'Display copyright information in footer', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_display_credits', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'default' => '1', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_display_credits', array( + 'section' => 'atticus_finch_misc', + 'type' => 'checkbox', + 'label' => __( 'Display developer credits in footer', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_edit_post_link', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'default' => '1', + 'sanitize_callback' => 'atticus_finch_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'atticus_finch_edit_post_link', array( + 'section' => 'atticus_finch_misc', + 'type' => 'checkbox', + 'label' => __( 'Display "Edit this post" link if user is logged in', 'atticus-finch' ), + ) ); + + + $wp_customize->add_setting( 'atticus_finch_excerpt_length', array( + 'type' => 'theme_mod', + 'transport' => 'postMessage', + 'default' => '20', + 'sanitize_callback' => 'atticus_finch_sanitize_excerpt', + ) ); + + $wp_customize->add_control( 'atticus_finch_excerpt_length', array( + 'section' => 'atticus_finch_misc', + 'type' => 'text', + 'label' => __( 'Excerpt length in number of words (maximum = 100)', 'atticus-finch' ), + ) ); + + +} + + +// Sanitizer Functions + +function atticus_finch_sanitize_checkbox( $input ) { + if ( $input == 1 ) { + return 1; + } else { + return ''; + } +} + +function atticus_finch_sanitize_text( $input ) { + return wp_kses_post( force_balance_tags( $input ) ); +} + +function atticus_finch_sanitize_excerpt( $input ) { + $input = absint( $input ); + if ( $input > 100 ) { $input = 100; } + return $input; +} + +function atticus_finch_sanitize_html( $input ) { + wp_kses($input, + array(), + array( + 'http' => array(), + 'https' => array(), + ) + ); +} + +function atticus_finch_sanitize_css( $input ) { + wp_filter_nohtml_kses( $input ); +} \ No newline at end of file diff --git a/functions/jetpack.php b/functions/jetpack.php new file mode 100644 index 0000000..c0cad48 --- /dev/null +++ b/functions/jetpack.php @@ -0,0 +1,30 @@ + 'main', + 'render' => 'atticus_finch_infinite_scroll_render', + 'footer' => 'page', + ) ); +} // end function atticus_finch_jetpack_setup +add_action( 'after_setup_theme', 'atticus_finch_jetpack_setup' ); + +/** + * Custom render function for Infinite Scroll. + */ +function atticus_finch_infinite_scroll_render() { + while ( have_posts() ) { + the_post(); + get_template_part( 'template-parts/content', get_post_format() ); + } +} // end function atticus_finch_infinite_scroll_render diff --git a/functions/template-tags.php b/functions/template-tags.php new file mode 100644 index 0000000..b734333 --- /dev/null +++ b/functions/template-tags.php @@ -0,0 +1,316 @@ +', 'atticus-finch' ), esc_attr( get_the_date( 'c' ) ) ); + echo ''; + printf(__( 'Posted on %s', 'atticus-finch' ), get_the_date() ); + $date; + echo ''; + } else { + printf(__( '