Skip to content

Commit

Permalink
Merge pull request #1 from ScottSmith95/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
ScottSmith95 committed Aug 22, 2013
2 parents 24f0a8b + c1dcc4b commit e148f7b
Show file tree
Hide file tree
Showing 12 changed files with 436 additions and 109 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Decode 2.6
# Decode 2.7
I built Decode, the theme I use on [Beyond The Code](http://beyondtheco.de), on the great theme foundation, [Underscores](http://underscores.me). It is built for mobile first, and uses media queries to bring in CSS for larger screens.

If you want to change any of the colors in your theme, enable the sidebar, social links, and more, access the Theme Customizer in the Appearance Menu > Customize. From here you can access all the settings avaliable for this theme.
Expand All @@ -9,6 +9,8 @@ Decode supports link posts, where the title can be hyperlinked. To do this, firs

Featured Images are also supported, allowing you to display large, beautiful images at the top of your posts. A site-wide header image can also be set in the Header Options section of the theme customizer.

To add an explore page to your site, simply add a page with the title "Explore" and Decode does the rest, adding an easy place to find new content on your site.

Lastly, Decode has social icons in the header that can link to your Twitter, App.net, Facebook, Google+, Dribbble, Behance, LinkedIn, Tumblr, Pinterest, Instagram, 500px, Flickr, Rdio, Spotify, Soundcloud, Vimeo, YouTube, Github, and Foursquare profiles. These can all be configured in the Customize menu as well.


Expand Down
10 changes: 8 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

<div id="comments" class="comments-area">

<?php // You can start editing here -- including this comment! ?>

<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
Expand Down Expand Up @@ -70,6 +68,14 @@
<?php endif; ?>

<?php comment_form(); ?>

<script>
jQuery(document).ready(function($){
$("textarea#comment").click(function(){
$('.form-allowed-tags').slideDown('250');
});
});
</script>

</div><!-- #comments -->

Expand Down
30 changes: 30 additions & 0 deletions content-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
<div class="entry-content"><?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'decode' ) ); ?></div>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'decode' ), 'after' => '</div>' ) ); ?>
<footer class="entry-meta">
<?php if (get_theme_mod( 'show_author_section', false ) == true ) : ?>
<section class="author-section cf">
<div class="author-image"><?php echo get_avatar( get_the_author_meta( 'ID' ), 128 ); ?></div>
<div class="author-text">
<div class="author-name"><?php echo get_the_author_meta( 'display_name' ); ?></div>
<?php if ( get_the_author_meta( 'user_url' ) ) echo '<div class="author-site"><a href="' . get_the_author_meta( 'user_url' ) . '">Website</a></div>'; ?>
<div class="author-bio"><?php echo get_the_author_meta( 'description' ); ?></div>
</div>
</section>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'decode' ), '<div class="edit-link">', '</div>' ); ?>
<p class="tags"><?php the_tags('Tagged in: ',', '); ?></p>
<p class="categories">Categorized in: <?php the_category(', '); ?></p>
Expand All @@ -25,6 +35,16 @@
</header>
<div class="entry-content"><?php the_content( __( 'continue reading &raquo;', 'decode' ) ); ?></div>
<footer class="entry-meta">
<?php if (get_theme_mod( 'show_author_section', false ) == true ) : ?>
<section class="author-section cf">
<div class="author-image"><?php echo get_avatar( get_the_author_meta( 'ID' ), 128 ); ?></div>
<div class="author-text">
<div class="author-name"><?php echo get_the_author_meta( 'display_name' ); ?></div>
<?php if ( get_the_author_meta( 'user_url' ) ) echo '<div class="author-site"><a href="' . get_the_author_meta( 'user_url' ) . '">Website</a></div>'; ?>
<div class="author-bio"><?php echo get_the_author_meta( 'description' ); ?></div>
</div>
</section>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'decode' ), '<div class="edit-link">', '</div>' ); ?>
<p class="tags"><?php the_tags('Tagged in: ',', '); ?></p>
<p class="categories">Categorized in: <?php the_category(', '); ?></p>
Expand All @@ -41,6 +61,16 @@
<div class="entry-content"><?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'decode' ) ); ?></div>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'decode' ), 'after' => '</div>' ) ); ?>
<footer class="entry-meta">
<?php if (get_theme_mod( 'show_author_section', false ) == true ) : ?>
<section class="author-section cf">
<div class="author-image"><?php echo get_avatar( get_the_author_meta( 'ID' ), 128 ); ?></div>
<div class="author-text">
<div class="author-name"><?php echo get_the_author_meta( 'display_name' ); ?></div>
<?php if ( get_the_author_meta( 'user_url' ) ) echo '<div class="author-site"><a href="' . get_the_author_meta( 'user_url' ) . '">Website</a></div>'; ?>
<div class="author-bio"><?php echo get_the_author_meta( 'description' ); ?></div>
</div>
</section>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'decode' ), '<div class="edit-link">', '</div>' ); ?>
<p class="tags"><?php the_tags('Tagged in: ',', '); ?></p>
<p class="categories">Categorized in: <?php the_category(', '); ?></p>
Expand Down
4 changes: 2 additions & 2 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package Decode
*/
?>

<?php if (get_theme_mod( 'constant_sidebar', 'closing' ) == 'constant' && get_theme_mod( 'show_sidebar', true ) == true ) { echo '</div><!-- .site-scroll -->'; } ?>
</div><!-- #content -->

<footer id="colophon" class="site-footer" role="contentinfo">
Expand All @@ -26,7 +26,7 @@
</div><!-- #page -->

<?php if (get_theme_mod( 'show_sidebar', true ) == true ) : ?>
<div id="sidebar" class="sidebar <?php echo get_theme_mod( 'sidebar_position', 'left' );?>">
<div id="sidebar" class="sidebar <?php echo get_theme_mod( 'sidebar_position', 'left' );?> <?php echo get_theme_mod( 'constant_sidebar', 'closing' );?>">
<div id="sidebar_top" class="SidebarTop">
<div id="sidebar_close" class="SidebarClose">
<svg width="200px" height="200px" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
Expand Down
29 changes: 18 additions & 11 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function decode_setup() {
/**
* Specifies for the theme to use HTML 5 tags
*/
add_theme_support( 'html5' );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', ) );

/**
* Add default posts and comments RSS feed links to head
Expand All @@ -47,7 +47,7 @@ function decode_setup() {
/**
* Enable support for Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', ) );

/**
* Setup the WordPress core custom background feature.
Expand Down Expand Up @@ -128,13 +128,13 @@ function decode_search_title_highlight() {

function decode_scripts() {

wp_register_style( 'decode-style', get_stylesheet_uri(), array(), "2.6.4" );
wp_register_style( 'decode-style', get_stylesheet_uri(), array(), "2.7" );

wp_register_style( 'decode-font-stylesheet', 'http://fonts.googleapis.com/css?family=Oxygen' );

wp_register_script( 'decode-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '2.2', true );

wp_register_script( 'decode-modernizr', get_template_directory_uri() . '/js/modernizr.js', array(), '2.3.2', true );
wp_register_script( 'decode-modernizr', get_template_directory_uri() . '/js/modernizr.js', array(), '2.7', true );

wp_register_script( 'decode-respond', get_template_directory_uri() . '/js/respond.js', array(), '2.5', true );

Expand All @@ -155,9 +155,10 @@ function decode_scripts() {

wp_enqueue_script( 'decode-respond' );

wp_enqueue_script( 'decode-fastclick' );

wp_enqueue_script( 'decode-sidebar' );
if (get_theme_mod( 'show_sidebar', true ) == true ) {
wp_enqueue_script( 'decode-fastclick' );
wp_enqueue_script( 'decode-sidebar' );
}
}
}
add_action( 'wp_enqueue_scripts', 'decode_scripts' );
Expand All @@ -176,19 +177,25 @@ function decode_customize_css()
background: <?php echo '#' . get_background_color(); ?>;
}

body, button, select, textarea, .site-title a, .no-touch .site-title a:hover, .no-touch .site-title a:active, .main-navigation a, .no-touch .main-navigation a:hover, .no-touch .main-navigation a:active, .entry-title, .search-entry, .search-entry .entry-title, .entry-title a, .format-link .entry-title h2 a, .explore-page .widget h1, .decode-reply-tool-plugin .replylink, .decode-reply-tool-plugin .replytrigger {
color: <?php echo get_theme_mod('text_color'); ?>;
}

<?php if (get_theme_mod( 'accent_color_icons', false ) == false ) : ?>
.SidebarMenuTrigger, .SidebarMenuClose, .SocialIconFill {
fill: <?php echo get_theme_mod('text_color'); ?>;
}

body, button, select, textarea, .site-title a, .no-touch .site-title a:hover, .no-touch .site-title a:active, .main-navigation a, .no-touch .main-navigation a:hover, .no-touch .main-navigation a:active, .entry-title, .search-entry, .search-entry .entry-title, .entry-title a, .format-link .entry-title h2 a, .decode-reply-tool-plugin .replylink, .decode-reply-tool-plugin .replytrigger {
color: <?php echo get_theme_mod('text_color'); ?>;
<?php else : ?>
.SidebarMenuTrigger, .SidebarMenuClose, .SocialIconFill {
fill: <?php echo get_theme_mod('accent_color'); ?>;
}
<?php endif; ?>

a, .no-touch a:hover, .no-touch .main-navigation a:hover, .search-entry:hover, .search-entry:hover .entry-title, .no-touch footer .date a:hover, .no-touch .format-link .entry-title a:hover, .no-touch .comment-metadata a:hover, .no-touch .decode-reply-tool-plugin .replylink:hover, .main-navigation li.current_page_item > a, .main-navigation li.current-menu-item > a {
color: <?php echo get_theme_mod('accent_color'); ?>;
}

.no-touch .entry-content a:hover, .no-touch .entry-meta a:hover, .site-header, .page-title, .post blockquote, .page blockquote, .post footer, .search .post, .search .page, .no-touch .theme-info a:hover, .SidebarTop, .no-touch .site-description a:hover, .no-touch button:focus, .touch button:focus, .no-touch input[type='button']:focus, .touch input[type='button']:focus, .no-touch input[type='reset']:focus, .touch input[type='reset']:focus, .no-touch input[type='submit']:focus, .touch input[type='submit']:focus, .no-touch button:active, .touch button:active, .no-touch html input[type='button']:active, .touch html input[type='button']:active, .no-touch input[type='reset']:active, .touch input[type='reset']:active, .no-touch input[type='submit']:active, .touch input[type='submit']:active, .no-touch input[type='text']:focus, .touch input[type='text']:focus, .no-touch input[type='email']:focus, .touch input[type='email']:focus, .no-touch input[type='password']:focus, .touch input[type='password']:focus, .no-touch input[type='search']:focus, .touch input[type='search']:focus, .no-touch input[type="tel"]:focus, .touch input[type="tel"]:focus, .no-touch input[type="url"]:focus, .touch input[type="url"]:focus, .no-touch textarea:focus, .touch textarea:focus {
.no-touch .entry-content a:hover, .no-touch .entry-meta a:hover, .site-header, .page-title, .post blockquote, .page blockquote, .post footer, .search .post, .search .page, .no-touch .theme-info a:hover, .SidebarTop, .sidebar.constant.left, .sidebar.constant.right, .no-touch .site-description a:hover, .explore-page .widget h1, .no-touch button:focus, .touch button:focus, .no-touch input[type='button']:focus, .touch input[type='button']:focus, .no-touch input[type='reset']:focus, .touch input[type='reset']:focus, .no-touch input[type='submit']:focus, .touch input[type='submit']:focus, .no-touch button:active, .touch button:active, .no-touch html input[type='button']:active, .touch html input[type='button']:active, .no-touch input[type='reset']:active, .touch input[type='reset']:active, .no-touch input[type='submit']:active, .touch input[type='submit']:active, .no-touch input[type='text']:focus, .touch input[type='text']:focus, .no-touch input[type='email']:focus, .touch input[type='email']:focus, .no-touch input[type='password']:focus, .touch input[type='password']:focus, .no-touch input[type='search']:focus, .touch input[type='search']:focus, .no-touch input[type="tel"]:focus, .touch input[type="tel"]:focus, .no-touch input[type="url"]:focus, .touch input[type="url"]:focus, .no-touch textarea:focus, .touch textarea:focus {
border-color: <?php echo get_theme_mod('accent_color'); ?>;
}

Expand Down
5 changes: 3 additions & 2 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
</head>

<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<div id="page" class="hfeed site<?php if (get_theme_mod( 'show_sidebar', true ) == true) { echo ' sidebar-style-' . get_theme_mod( 'constant_sidebar', 'closing' ) . ' sidebar-style-' . get_theme_mod( 'sidebar_position', 'left' ); }?>">
<?php do_action( 'before' ); ?>
<?php if (get_theme_mod( 'constant_sidebar', 'closing' ) == 'constant' && get_theme_mod( 'show_sidebar', true ) == true) { echo '<div class="site-scroll">'; } ?>

<header id="masthead" class="site-header" role="banner">

<?php if (get_theme_mod( 'show_sidebar', true ) == true ) : ?>
<?php if (get_theme_mod( 'show_sidebar', true ) == true) : ?>
<div id="sidebar_link" class="SidebarLink <?php echo get_theme_mod( 'sidebar_button_position', 'left' );?>">
<svg width="240px" height="200px" viewBox="0 0 240 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
<title>Menu</title>
Expand Down
64 changes: 52 additions & 12 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function render_content() {

$wp_customize->add_setting( 'show_site_navigation', array(
'default' => true,
'transport' => 'postMessage',
'transport' => 'refresh',
) );

$wp_customize->add_setting( 'html_description', array(
Expand Down Expand Up @@ -124,7 +124,7 @@ public function render_content() {

$wp_customize->add_setting( 'show_sidebar', array(
'default' => true,
'transport' => 'postMessage',
'transport' => 'refresh',
) );

$wp_customize->add_setting( 'sidebar_position', array(
Expand All @@ -134,6 +134,10 @@ public function render_content() {
$wp_customize->add_setting( 'sidebar_button_position', array(
'default' => 'left',
) );

$wp_customize->add_setting( 'constant_sidebar', array(
'default' => 'closing',
) );


$wp_customize->add_control( 'show_sidebar', array(
Expand Down Expand Up @@ -164,6 +168,18 @@ public function render_content() {
),
'priority'=> 3,
) );

$wp_customize->add_control( 'constant_sidebar', array(
'label' => 'Always Visible Sidebar',
'section' => 'decode_sidebar_options',
'type' => 'radio',
'choices' => array(
'constant' => 'Always open',
'closing' => 'Closed by default',
),
'priority'=> 4,

) );



Expand All @@ -179,7 +195,7 @@ public function render_content() {

$wp_customize->add_setting( 'enable_comments', array(
'default' => true,
'transport' => 'postMessage',
'transport' => 'refresh',
) );


Expand All @@ -204,7 +220,7 @@ public function render_content() {

$wp_customize->add_setting( 'show_social_icons', array(
'default' => false,
'transport' => 'postMessage',
'transport' => 'refresh',
) );

$wp_customize->add_setting( 'twitter_username', array(
Expand Down Expand Up @@ -453,22 +469,27 @@ public function render_content() {

$wp_customize->add_setting( 'show_tags', array(
'default' => false,
'transport' => 'postMessage',
'transport' => 'refresh',
) );

$wp_customize->add_setting( 'show_categories', array(
'default' => false,
'transport' => 'postMessage',
'transport' => 'refresh',
) );

$wp_customize->add_setting( 'show_author_section', array(
'default' => false,
'transport' => 'refresh',
) );

$wp_customize->add_setting( 'link_post_title_arrow', array(
'default' => false,
'transport' => 'postMessage',
'transport' => 'refresh',
) );

$wp_customize->add_setting( 'show_theme_info', array(
'default' => true,
'transport' => 'postMessage',
'transport' => 'refresh',
) );

$wp_customize->add_setting( 'site_colophon', array(
Expand Down Expand Up @@ -497,26 +518,33 @@ public function render_content() {
'type' => 'checkbox',
'priority'=> 3,
) );

$wp_customize->add_control( 'show_author_section', array(
'label' => 'Show author\'s name, profile image, and bio after posts',
'section' => 'decode_reading_options',
'type' => 'checkbox',
'priority'=> 4,
) );

$wp_customize->add_control( 'link_post_title_arrow', array(
'label' => 'Add an arrow before the title of a link post',
'section' => 'decode_reading_options',
'type' => 'checkbox',
'priority'=> 4,
'priority'=> 5,
) );

$wp_customize->add_control( 'show_theme_info', array(
'label' => 'Show Theme Info (display a line of text about the theme and its creator at the bottom of pages)',
'section' => 'decode_reading_options',
'type' => 'checkbox',
'priority'=> 5,
'priority'=> 6,
) );

$wp_customize->add_control( new Decode_Customize_Textarea_Control( $wp_customize, 'site_colophon', array(
'label' => 'Text (colophon, copyright, credits, etc.) for the footer of the site',
'section' => 'decode_reading_options',
'settings'=> 'site_colophon',
'priority'=> 6,
'priority'=> 7,
) ) );


Expand Down Expand Up @@ -544,6 +572,11 @@ public function render_content() {
'default' => '#808080',
'transport' => 'refresh',
) );

$wp_customize->add_setting( 'accent_color_icons', array(
'default' => false,
'transport' => 'refresh',
) );


$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'accent_color', array(
Expand All @@ -569,6 +602,12 @@ public function render_content() {
'section' => 'colors',
'settings' => 'secondary_text_color',
) ) );

$wp_customize->add_control( 'accent_color_icons', array(
'label' => 'Use accent color instead of text color for icons',
'section' => 'colors',
'type' => 'checkbox',
) );

}
add_action( 'customize_register', 'decode_customize_register' );
Expand All @@ -578,6 +617,7 @@ public function render_content() {
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function decode_customize_preview_js() {
wp_enqueue_script( 'decode_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '2.6.3', true );
wp_register_script( 'decode-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview', 'jquery' ), '2.7', true );
wp_enqueue_script( 'decode-customizer' );
}
add_action( 'customize_preview_init', 'decode_customize_preview_js' );
12 changes: 9 additions & 3 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,15 @@ function decode_comment( $comment, $args, $depth ) {
<?php comment_text(); ?>
</div><!-- .comment-content -->

<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
<?php
comment_reply_link( array_merge( $args, array(
'add_below' => 'div-comment',
'depth' => $depth,
'max_depth' => $args['max_depth'],
'before' => '<div class="reply">',
'after' => '</div>',
) ) );
?>
</article><!-- .comment-body -->

<?php
Expand Down
Loading

0 comments on commit e148f7b

Please sign in to comment.