Twenty Fourteen Theme Customization

WordPress 3.9 came out and theme Twenty Fourteen came with it. The theme is great, but it does kill many of the mootools and older jqueries scripts that I’ve been using like Mediabox Advance and FancyBox 1.3.4. Anyhow, this is how I modified a Twenty Fourteen Theme. My goal is to have 3 colors on the page gradually lightened – I called my twenty fourteen – black because I like dark themes. I read many fixes and posts on the websites and I try to give credit to the original writers, but some I really forgot where I got my information from, I’m really sorry.

The first thing I want to do is to add excerpts and thumbnails to the index – front page. For the thumbnails, I get the “get_the_image.php” and place it in the original Twenty Fourteen theme. Add the scripts to the function.php

 

if (!function_exists(‘get_the_image’)) {
require_once “get-the-image.php”;
}
function custom_excerpt_length( $length ) {
return 50;
}
add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );

 

I also need to edit the content.php of the original theme to display thumbnails size and excerpts

 

<?php if ( is_search()||is_author()||is_tag()||is_archive()||is_home() ) : // Only display Excerpts for Search ?>
<div class=”entry-summary”>
<?php
get_the_image( array( ‘size’ => ‘main’, ‘width’ => 200, ‘height’ => 114, ‘before’ => ‘<div class=”cover”>’, ‘after’ => ‘</div>’ ) );
?>
<?php the_excerpt(); ?>
</div><!– .entry-summary –>
<?php else : ?>

 

Now the index – front page should look like this. I can change the excerpts from 50 to any size of words I want.

     thumbnails and excerpts on front page

If you have many blogs like I do, and you want many different color themes for each blog, the best is to use child theme. To create a child theme, I create a folder for the theme and inside the folder, I should have a modified style.css and a css folder with modified ie.css in it.

child theme folder

child theme css folder

At the beginning of the child theme style.css, I replaced everything on the top with my information – important thing is the @import command

 

/*
Theme Name: Twenty Fourteen black1600
Theme URI: http://example.com/twenty-fourteen-child/
Description: Twenty Fourteen Child Theme
Author: idog
Author URI: http://www.dognmonkey.com/techs
Template: twentyfourteen
Version: 1.0.0
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-fourteen-child
*/
@import url(“../twentyfourteen/style.css”);

 

Next, to fix the color of the internet explorer 8/9, I had to add some codes in the function.php, the original codes are here by fatpat76.

 

function mytheme_dequeue_styles() {
wp_dequeue_style( ‘twentyfourteen-ie’ );
}
add_action( ‘wp_enqueue_scripts’, ‘mytheme_dequeue_styles’, 11 );
//add new from child theme
wp_enqueue_style( ‘mytheme-ie’, get_stylesheet_directory_uri() . ‘/css/ie.css’, array( ‘twentyfourteen-style’ ), ‘1.0’ );
$wp_styles->add_data( ‘mytheme-ie’, ‘conditional’, ‘lt IE 9’ );

 

Now, I’m ready to change colors and format of the style.css that I like to have for my theme.

 

3 Shades of color will be used : content = #111111 (darkest), primary-sidebar-header-footer = #191919 (lighter) , background = #1d1d1d (lightest).

 

Center the page on larger screen : I need to add these codes in the style.css.

 

#page {
margin-left: auto;
margin-right: auto;
}

 

Change the site background color and size from 1260px to 1366px:

 

.site {
background-color: #111111;
max-width: 1366px;
position: relative;
}

body,
button,
input,
select,
textarea {
color: #aaa;/*#2b2b2b;idog*/
font-family: Comic Sans MS,Lucida Sans Unicode,Arial,Helvetica,sans-serif, Lato;
font-size: 16px;
font-weight: 400;
line-height: 1.5;
font-style:italic;
}

body {
background-color: #191919;/*backgroundidog*/
}

a {
color: #cf3822;/*#24890d;idog*/
text-decoration: none;
}

.site-header {
background-color: #191919;/*#000;*/
max-width: 1366px;
position: relative;
width: 100%;
z-index: 4;
}

.site-footer {
/*border-top: 4px solid #666;/*borderidog */
background-color: #191919;/*#000;idog*/
font-size: 12px;
position: relative;
z-index: 3;
}

.site:before {
background-color: #191919;/*primary-sidebar idog*/

@media screen and (min-width: 1366px) {
.site-content blockquote.alignleft,
.site-content blockquote.alignright {
width: -webkit-calc(50% + 18px);
width: calc(50% + 18px);
}

blockquote {
background: #191919;
padding: 2%;
color: #eee;/*#767676;*/
font-size: 16px;
font-style: italic;
font-weight: 300;
line-height: 1.2631578947;
margin-bottom: 24px;
}
/* Input fields */

input,
textarea {
border: 1px solid #666;/*rgba(0, 0, 0, 0.1);idog*/
/* border-radius: 2px;*/
color: #aaa;/*#2b2b2b;*/
padding: 8px 10px 7px;
background:#191919;/*comment area backgroundidog*/
}

input[type=”button[/title]

,
input[type=”reset[/title]
,
input[type=”submit[/title]
{
background-color: #191919;

.site-content .entry-meta {
background-color: #111111;/*#fff;/*content text*/
margin-bottom: 8px;
}

.entry-meta .tag-links a {
background-color: #191919;/*backgroundidog#767676; idog*/
border-radius: 0 2px 2px 0;
color: #cf3822;/*coloridog*/

.paging-navigation a:hover {
border-top: 5px solid #666;/*;idog*/
color: #ff6611;/*coloridog #2b2b2b;*/
background:#191919;/*idog add*/
}

.comment-content {
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
word-wrap: break-word;
background: #191919;/*idog*/
padding:10px;/*idog*/
}

#secondary {
background-color: #191919;/*backgroundidog*/
border-top: 1px solid #000;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
clear: both;
color: rgba(255, 255, 255, 0.7);
margin-top: -1px;
padding: 0 10px;
position: relative;
z-index: 2;
}

.widget textarea {
background-color: #191919;/*rgba(255, 255, 255, 0.1); searchbox left column*/
border-color: rgba(255, 255, 255, 0.2);
color: #fff;
font-size: 16px;
padding: 1px 2px 2px 4px;
}

.content-sidebar .widget textarea {
background-color: #191919;/*#fff;searchbox right column*/
border-color: rgba(0, 0, 0, 0.1);
color: #bbb;/*#2b2b2b;idog*/
}

Leave a Reply

Your email address will not be published. Required fields are marked *