Skip to content

Commit

Permalink
Some Commenting and Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham9411 committed Feb 16, 2017
1 parent 3cc23f6 commit 123efde
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 28 deletions.
5 changes: 3 additions & 2 deletions README.md
@@ -1,2 +1,3 @@
# solitude
A WordPress Theme
# Solitude

## A Simple blog focued theme with card design. Based on Bootstrap.
15 changes: 15 additions & 0 deletions footer.php
@@ -1,3 +1,18 @@
<?php
/**
* The template for displaying the footer
*
* Contains the closing of the #content div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Solitude
* @since 1.0
* @version 1.0
*/

?>
</div><!-- #content -->

<footer>
Expand Down
59 changes: 53 additions & 6 deletions functions.php
@@ -1,11 +1,31 @@
<?php
/**
* Solitude functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package WordPress
* @subpackage Solitude
* @since 1.0
*/

if ( ! isset( $content_width ) ) $content_width = 700;
/**
* Set the content width based on the theme's design and stylesheet.
*
* @since Solitude 1.0
*/
if ( ! isset( $content_width ) ) {
$content_width = 700;
}

if( ! function_exists( 'solitude_scripts' ) ):
/**
* Enqueue scripts and styles
*/
if ( ! function_exists( 'solitude_scripts' ) ) :

function solitude_scripts() {
wp_enqueue_style( 'solitude-style' , get_stylesheet_uri() , array('solitude-bootstrap') , '15022017' , 'all' );
wp_enqueue_style( 'solitude_google_fonts' );
wp_enqueue_style( 'solitude-style' , get_stylesheet_uri() , array( 'solitude-bootstrap' ) , '15022017' , 'all' );
wp_enqueue_style( 'solitude-bootstrap' , get_theme_file_uri( '/css/bootstrap.css' ) , array() , '3.3.7' , 'all' );
wp_enqueue_script( 'solitude-main' , get_theme_file_uri( '/js/main.js' ) , array( 'jquery' ) , '15022017' , true );
wp_enqueue_script( 'solitude-bootstrap-js' , get_theme_file_uri( '/js/bootstrap.js' ) , array( 'jquery' ) , '3.3.7' , true );
Expand All @@ -15,7 +35,17 @@ function solitude_scripts() {

endif;

if ( ! function_exists( 'solitude_setup' ) ):

if ( ! function_exists( 'solitude_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*
* @since Solitude 1.0
*/

function solitude_setup() {

Expand Down Expand Up @@ -55,7 +85,7 @@ function solitude_setup() {
add_editor_style( array( 'css/editor-style.css' ) );

}

add_action( 'after_setup_theme', 'solitude_setup' );

endif;
Expand All @@ -70,4 +100,21 @@ function solitude_setup() {
function solitude_javascript_detection() {
echo "<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>\n";
}
add_action( 'wp_head', 'solitude_javascript_detection', 0 );
add_action( 'wp_head', 'solitude_javascript_detection', 0 );

if ( ! function_exists( 'solitude_google_fonts' ) ) {

/**
* Add Google Fonts
*
* @since Solitude 1.0
*/

function solitude_google_fonts(){
$query_args = array(
'family' => 'Lato',
);
wp_register_style( 'solitude_google_fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null );
}
add_action('init', 'solitude_google_fonts');
}
28 changes: 9 additions & 19 deletions header.php
Expand Up @@ -3,13 +3,13 @@
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Solitude
* @since 1.0
* @version 1.0
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Solitude
* @since 1.0
* @version 1.0
*/?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
Expand All @@ -18,12 +18,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<style type="text/css">
body{
font-family: 'Lato' , sans-sarif;
}
</style>
</head>
<body <?php body_class(); ?>>
<div id="page" class="site">
Expand All @@ -47,17 +41,13 @@

</ul>
<?php
/**
* Displays a navigation menu
* @param array $args Arguments
*/
$args = array(
'theme_location' => 'top',
'container' => 'ul',
'menu_class' => 'nav navbar-nav navbar-right',
'items_wrap' => '<ul id = "%1$s" class = "%2$s">%3$s</ul>',
'depth' => 1,
'walker' => ''
'walker' => '',
);
wp_nav_menu( $args );
?>
Expand All @@ -66,4 +56,4 @@
</nav>
</header><!-- /header -->
<div class="site-content-contain">
<div id="content" class="site-content">
<div id="content" class="site-content">
15 changes: 14 additions & 1 deletion index.php
@@ -1,6 +1,19 @@
<?php
/**
* 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
*
* @package Solitude
* @since Solitude 1.0
*/

get_header();
?>

<?php
get_footer();
get_footer();

0 comments on commit 123efde

Please sign in to comment.