Created
August 25, 2014 19:09
-
-
Save andredelgado/a6c9a3a9bb502ff6653f to your computer and use it in GitHub Desktop.
wordpress skeleton theme code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpSkeleton_register_theme_menu() { | |
register_nav_menu('primary', 'main menu'); | |
} | |
function wpSkeleton_theme_support() { | |
add_theme_support( 'post-thumbnails' ); | |
} | |
function wpSkeleton_title_for_home( $title ) | |
{ | |
if( empty( $title ) && ( is_home() || is_front_page() ) ) { | |
return __( 'Home', 'theme_domain' ) . ' | ' . get_bloginfo( 'description' ); | |
} | |
return $title; | |
} | |
add_action('init', 'wpSkeleton_register_theme_menu'); | |
add_action( 'after_setup_theme', 'wpSkeleton_theme_support' ); | |
add_filter( 'wp_title', 'wpSkeleton_title_for_home' ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html <?php language_attributes(); ?> > | |
<head> | |
<meta charset="<?php bloginfo( 'charset' ); ?>" /> | |
<title><?php wp_title(''); ?></title> | |
<link rel="profile" href="http://gmpg.org/xfn/11" /> | |
<link rel="icon" href="assets/favicon.ico" type="image/x-icon" /> | |
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> | |
<?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?> | |
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" /> | |
<?php wp_head(); ?> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<div class="container"> | |
<!-- #### THE LOOP #### --> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<h2><?php the_title(); ?></h2> | |
<span class="author">Written by <?php the_author(); ?></span> | |
<span class="date">on <?php the_time('F jS, Y'); ?></span> | |
<?php the_content('(Read More...)'); ?> | |
<?php endwhile; else : ?> | |
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> | |
<?php endif; ?> | |
</div> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<div class="container"> | |
<!-- #### THE LOOP #### --> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<h2><?php the_title(); ?></h2> | |
<span class="author">Written by <?php the_author(); ?></span> | |
<span class="date">on <?php the_time('F jS, Y'); ?></span> | |
<?php the_content('(Read More...)'); ?> | |
<?php endwhile; else : ?> | |
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> | |
<?php endif; ?> | |
</div> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: My first theme | |
Theme URI: http://andreny.com/ | |
Author: André Delgado | |
Author URI: http://andreny.com/ | |
Description: My first wordpress theme | |
Version: 1.0 | |
*/ | |
body { | |
margin: 0; | |
padding: 0; | |
} | |
.container { | |
width: 600px; | |
margin: 0 auto; | |
} | |
footer p { | |
text-align: center; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment