Skip to content
Snippets Groups Projects
Commit 85ff755e authored by root's avatar root Committed by lechuck
Browse files

Add theme hybrid-news

parent 9af50ccd
Branches
No related tags found
No related merge requests found
Showing
with 516 additions and 0 deletions
/**
* Front Page Stylesheet
* This is only loaded when using the front-page.php page template
*
* @since 0.1
*/
/**
* Featured slider
************************************************/
#slider-container {
overflow: hidden;
width: 600px;
height: 250px;
margin: 0 0 30px 0;
background: #093653;
}
#slider {
overflow: hidden;
width: 580px;
height: 230px;
}
.feature {
overflow: hidden;
width: 560px;
height: 210px;
padding: 10px 10px 0 10px;
color: #ccc;
background: #093653;
border: none !important;
}
#slider-container a {
color: #ddd;
font-weight: bold;
}
.feature img {
float: left;
max-width: 230px;
max-height: 200px;
width: 230px;
height: 200px;
margin: 0 15px 0 0;
border: 5px solid #001838;
}
#slider .feature .entry-title {
font-size: 21px;
}
#slider .feature .entry-title a {
color: #eee;
}
.feature .byline {
color: #aaa;
margin-bottom: 15px;
}
.more-link {
float: left;
text-indent: -9999px;
width: 100px;
height: 20px;
display: block;
background: url(../images/more-link.gif) no-repeat 0 0;
}
.more-link:hover {
background: url(../images/more-link.gif) no-repeat 0 -20px;
}
/* Slider controls */
.slider-controls {
float: left;
width: 66px;
height: 20px;
overflow: hidden;
clear: both;
line-height: 15px;
margin: 0 0 0;
padding: 0 10px 0 524px;
background: #062f4a;
border-top: 2px solid #03273f;
}
.slider-controls .slider-prev {
text-indent: -9999px;
float: left;
width: 22px;
height: 20px;
background: #062F4A url(../images/slider-prev.gif) no-repeat 0 0;
border: none !important;
}
.slider-controls .slider-prev:hover {
background: #062F4A url(../images/slider-prev.gif) no-repeat left -20px;
}
.slider-controls .slider-pause {
text-indent: -9999px;
float: left;
width: 22px;
height: 20px;
background: #062F4A url(../images/pause.gif) no-repeat center 0;
border: none !important;
}
.slider-controls .slider-pause:hover, .slider-controls a.paused {
background: #062F4A url(../images/pause.gif) no-repeat center -20px;
}
.slider-controls .slider-next {
text-indent: -9999px;
float: right;
width: 22px;
height: 20px;
background: #062F4A url(../images/slider-next.gif) no-repeat right 0;
border: none !important;
}
.slider-controls .slider-next:hover {
background: #062F4A url(../images/slider-next.gif) no-repeat right -20px;
}
/**
* Featured excerpts
************************************************/
.content .entry-title, #content .entry-title {
margin-bottom: 3px;
font: 15px/18px georgia, times, 'times new roman', serif;
font-weight: bold;
}
.byline {
margin-bottom: 3px;
}
.post {
border-bottom: 1px solid #ddd;
}
.page-template-front-page .entry-meta {
display: none;
}
/**
* Headlines
************************************************/
.section-title {
font-size: 15px;
font-weight: bold;
margin: 0 0 5px 0;
padding: 0 0 5px 0;
border-bottom: 1px solid #ddd;
}
#headlines .section-title {
}
#headlines {
overflow: hidden;
}
#headlines .odd {
float: left;
overflow: hidden;
width: 280px;
clear: both;
}
#headlines .even {
float: right;
overflow: hidden;
width: 280px;
clear: none;
}
#headlines ul {
font-size: 11px;
margin-left: 5px;
}
#headlines ul li {
background: url(../images/bullet.gif) no-repeat 0 7px;
}
#headlines ul li a {
font-weight: bold;
}
#content .post, .content .post {
clear: both;
margin-bottom: 20px;
}
.wp-pagenavi, .navigation-links {
display: none;
}
\ No newline at end of file
/**
* Tabs Stylesheet
* For use with the Hybrid Tabs plugin
*
* @since 0.1
*/
.tab-content {
display: none;
}
.t1 {
display: block;
}
/**
* Primary tabs and content-area widget tabs
***********************************************/
#content .widget-tabs, #primary .widget-tabs {
margin: 0 0 20px 0 !important;
padding: 0 !important;
background: transparent !important;
border: none !important;
}
#content .widget-tabs .widget-inside, #primary .widget-tabs .widget-inside {
padding: 0 !important;
background: transparent !important;
border: none !important;
}
#content .widget-tabs ul.tabs, #primary .widget-tabs ul.tabs {
overflow: hidden;
list-style: none;
margin: 0 0 7px 0;
}
#content .widget-tabs li.t, #primary .widget-tabs li.t {
float: left;
display: inline;
margin: 0 7px 0 0;
padding: 0;
background: transparent;
border: 1px solid #ddd !important;
text-align: center;
}
#content .widget-tabs li.t a, #primary .widget-tabs li.t a {
display: block;
padding: 7px 12px;
font-weight: bold;
color: #666;
background: #fff;
}
#content .widget-tabs li.t a:hover, #primary .widget-tabs li.t a:hover {
background: #eee;
text-decoration: none;
}
#content .widget-tabs li.t a.tab-current, #primary .widget-tabs li.t a.tab-current {
color: #4b6e85;
background: #fff;
color: #f7f7f7;
background: #093653;
}
#content .widget-tabs .tab-content, #primary .widget-tabs .tab-content {
overflow: hidden;
clear: left;
padding: 9px 9px 0 9px;
background: #fff;
border: 1px solid #ddd;
}
/**
* Primary widget tabs
************************************************/
#primary .widget-tabs ul.tabs {
width: 320px;
}
#primary .widget-tabs li.t4 {
margin: 0;
}
\ No newline at end of file
<?php
/**
* Functions File
*
* This is your child theme's functions.php file. It is here for adding custom functions and
* setting up default functionality for this child theme. You are free to modify this file in
* any way you like. Note that if you change the functions already within this file, you run
* the risk of losing theme functionality. Alter the functions below only if you know what
* you're doing.
*
* @package HybridNews
* @subpackage Functions
*/
/* Set up the Hybrid News child theme and its default functionality. */
add_action( 'after_setup_theme', 'hybrid_news_setup' );
/**
* Adds all the default actions and filters to their appropriate hooks and sets up anything
* else needed by the theme.
*
* @since 0.3
*/
function hybrid_news_setup() {
/* Get the parent theme prefix for use with its hooks. */
$prefix = hybrid_get_prefix();
/* Load any translation files for the user. */
load_child_theme_textdomain( 'hybrid-news', get_stylesheet_directory() );
/* Register additional menus. */
add_action( 'init', 'hybrid_news_register_menus', 11 );
/* Register additional sidebars. */
add_action( 'init', 'hybrid_news_register_sidebars', 11 );
/* Perform specific functions for the front page template. */
add_action( 'template_redirect', 'hybrid_news_front_page_template' );
/* Add the secondary menu before the header. */
add_action( "{$prefix}_before_header", 'hybrid_news_get_secondary_menu' );
/* Add the header sidebar to the header. */
add_action( "{$prefix}_header", 'hybrid_news_get_utility_header', 11 );
/* Add the post author box after singular posts. */
add_action( "{$prefix}_singular-post_after_singular", 'hybrid_news_author_box' );
/* Add the tertiary sidebar after the secondary sidebar. */
add_action( "{$prefix}_after_container", 'hybrid_news_get_tertiary', 11 );
/* Set up the theme settings meta box. */
add_action( 'admin_menu', 'hybrid_news_create_meta_box' );
/* Save the theme settings meta box settings. */
add_action( "{$prefix}_update_settings_page", 'hybrid_news_save_meta_box' );
/* Additional arguments for the post meta box of the parent theme. */
add_filter( "{$prefix}_post_meta_box_args", 'hybrid_news_post_meta_box_args' );
}
/**
* Registers additional nav menus for use with this theme.
*
* @since 0.3
*/
function hybrid_news_register_menus() {
register_nav_menu( 'secondary-menu', __( 'Secondary Menu', 'hybrid-news' ) );
}
/**
* Loads the menu-secondary.php template, which displays the Secondary Menu.
*
* @since 0.3
*/
function hybrid_news_get_secondary_menu() {
locate_template( array( 'menu-secondary.php', 'menu.php' ), true );
}
/**
* Register additional widget areas
*
* @since 0.3
*/
function hybrid_news_register_sidebars() {
register_sidebar( array( 'name' => __( 'Tertiary', 'hybrid-news' ), 'id' => 'tertiary', 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
register_sidebar( array( 'name' => __( 'Utility: Header', 'hybrid-news' ), 'id' => 'utilityheader', 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
}
/**
* Loads the sidebar-header.php template, which loads the Utility: Header sidebar.
*
* @since 0.3
*/
function hybrid_news_get_utility_header() {
get_sidebar( 'header' );
}
/**
* Loads the sidebar-tertiary.php template, which displays the Tertiary sidebar.
*
* @since 0.3
*/
function hybrid_news_get_tertiary() {
get_sidebar( 'tertiary' );
}
/**
* Adds JavaScript and CSS to Front Page page template.
* Also removes the breadcrumb menu.
*
* @since 0.3
*/
function hybrid_news_front_page_template() {
/* If we're not looking at the front page template, return. */
if ( !is_page_template( 'page-front-page.php' ) )
return;
/* Load the jQuery Cycle plugin JavaScript and custom JavaScript for it. */
wp_enqueue_script( 'slider', get_stylesheet_directory_uri() . '/js/jquery.cycle.js', array( 'jquery' ), 0.1, true );
/* Load the front page stylesheet. */
wp_enqueue_style( 'front-page', get_stylesheet_directory_uri() . '/css/front-page.css', false, '0.1', 'screen' );
/* Remove the breadcrumb trail. */
remove_action( 'hybrid_before_content', 'hybrid_breadcrumb' );
}
/**
* Shows an author description after the post but before the comments section on
* singular post views.
*
* @since 0.3
*/
function hybrid_news_author_box() { ?>
<div class="author-profile vcard">
<?php echo get_avatar( get_the_author_email(), '96' ); ?>
<h4 class="author-name fn n"><?php the_author_posts_link(); ?></h4>
<?php the_author_meta( 'description' ); ?>
</div><?php
}
/**
* Adds a medium/feature image setting to the post meta box.
*
* @since 0.3
*/
function hybrid_news_post_meta_box_args( $meta_boxes ) {
$meta_boxes['medium'] = array( 'name' => 'Medium', 'default' => '', 'title' => __( 'Medium/Feature:', 'hybrid-news' ), 'type' => 'text', 'show_description' => false, 'description' => false );
return $meta_boxes;
}
/**
* Saves the theme settings for Hybrid News if the user has added any.
*
* @since 0.3
*/
function hybrid_news_save_meta_box() {
/* Verify the nonce, so we know this is secure. */
if ( !wp_verify_nonce( $_POST['front_page_meta_box_nonce'], basename( __FILE__ ) ) )
return false;
$settings = get_option( 'hybrid_news_theme_settings' );
$settings['feature_category'] = absint( $_POST['feature_category'] );
$settings['excerpt_category'] = absint( $_POST['excerpt_category'] );
$settings['feature_num_posts'] = absint( $_POST['feature_num_posts'] );
$settings['excerpt_num_posts'] = absint( $_POST['excerpt_num_posts'] );
$settings['headlines_num_posts'] = absint( $_POST['headlines_num_posts'] );
$settings['headlines_category'] = (array)$_POST['headlines_category'];
$updated = update_option( 'hybrid_news_theme_settings', $settings );
}
/**
* Adds a meta box to the theme settings page in the admin.
*
* @since 0.3
*/
function hybrid_news_create_meta_box() {
add_meta_box( 'hybrid-news-front-page-box', __( 'Front Page template settings', 'hybrid-news' ), 'hybrid_news_front_page_meta_box', 'appearance_page_theme-settings', 'normal', 'low' );
}
/**
* Outputs the meta box and its form for the theme settings page.
*
* @since 0.3
*/
function hybrid_news_front_page_meta_box() {
$categories = get_categories();
$settings = get_option( 'hybrid_news_theme_settings' ); ?>
<input type="hidden" name="front_page_meta_box_nonce" value="<?php echo wp_create_nonce( basename( __FILE__ ) ); ?>" />
<table class="form-table">
<tr>
<th><label for="feature_category"><?php _e( 'Feature Category:', 'hybrid-news' ); ?></label></th>
<td>
<select id="feature_category" name="feature_category">
<option value="" <?php selected( $settings['feature_category'], '' ); ?>></option>
<?php foreach ( $categories as $cat ) { ?>
<option value="<?php echo $cat->term_id; ?>" <?php selected( $settings['feature_category'], $cat->term_id ); ?>><?php echo esc_html( $cat->name ); ?></option>
<?php } ?>
</select>
<?php _e( 'Leave blank to use sticky posts.', 'hybrid-news' ); ?>
</td>
</tr>
<tr>
<th><label for="feature_num_posts"><?php _e( 'Featured Posts:', 'hybrid-news' ); ?></label></th>
<td>
<input type="text" id="feature_num_posts" name="feature_num_posts" value="<?php echo esc_attr( $settings['feature_num_posts'] ); ?>" size="2" maxlength="2" />
<label for="feature_num_posts"><?php _e( 'How many feature posts should be shown?', 'hybrid-news' ); ?></label>
</td>
</tr>
<tr>
<th><label for="excerpt_category"><?php _e( 'Excerpts Category:', 'hybrid-news' ); ?></label></th>
<td>
<select id="excerpt_category" name="excerpt_category">
<option value="" <?php selected( $settings['excerpt_category'], '' ); ?>></option>
<?php foreach( $categories as $cat ) { ?>
<option value="<?php echo $cat->term_id; ?>" <?php selected( $settings['excerpt_category'], $cat->term_id ); ?>><?php echo esc_html( $cat->name ); ?></option>
<?php } ?>
</select>
</td>
</tr>
<tr>
<th><label for="excerpt_num_posts"><?php _e( 'Excerpts Posts:', 'hybrid-news' ); ?></label></th>
<td>
<input type="text" id="excerpt_num_posts" name="excerpt_num_posts" value="<?php echo esc_attr( $settings['excerpt_num_posts'] ); ?>" size="2" maxlength="2" />
<label for="excerpt_num_posts"><?php _e('How many excerpts should be shown?', 'hybrid-news' ); ?></label>
</td>
</tr>
<tr>
<th><label for="headlines_category"><?php _e( 'Headline Categories:', 'hybrid-news' ); ?></label></th>
<td>
<label for="headlines_category"><?php _e( 'Multiple categories may be chosen by holding the <code>Ctrl</code> key and selecting.', 'hybrid-news' ); ?></label>
<br />
<select id="headlines_category" name="headlines_category[]" multiple="multiple" style="height:150px;">
<?php foreach( $categories as $cat ) { ?>
<option value="<?php echo $cat->term_id; ?>" <?php if( is_array( $settings['headlines_category'] ) && in_array( $cat->term_id, $settings['headlines_category'] ) ) echo ' selected="selected"'; ?>><?php echo esc_html( $cat->name ); ?></option>
<?php } ?>
</select>
</td>
</tr>
<tr>
<th><label for="headlines_num_posts"><?php _e('Headlines Posts:', 'hybrid-news' ); ?></label></th>
<td>
<input type="text" id="headlines_num_posts" name="headlines_num_posts" value="<?php echo esc_attr( $settings['headlines_num_posts'] ); ?>" size="2" maxlength="2" />
<label for="headlines_num_posts"><?php _e( 'How many posts should be shown per headline category?', 'hybrid-news' ); ?></label>
</td>
</tr>
</table><!-- .form-table --><?php
}
?>
\ No newline at end of file
wp-content/themes/hybrid-news/images/bg-header.png

435 B

wp-content/themes/hybrid-news/images/bg-primary-menu.png

166 B

wp-content/themes/hybrid-news/images/bg.png

142 B

wp-content/themes/hybrid-news/images/bullet.gif

244 B

wp-content/themes/hybrid-news/images/cat-nav-border.png

189 B

wp-content/themes/hybrid-news/images/code.png

190 B

wp-content/themes/hybrid-news/images/container-bg.png

2.21 KiB

wp-content/themes/hybrid-news/images/feed-icon.png

690 B

wp-content/themes/hybrid-news/images/more-link.gif

2.76 KiB

wp-content/themes/hybrid-news/images/pause.gif

623 B

wp-content/themes/hybrid-news/images/pingback.jpg

1.62 KiB

wp-content/themes/hybrid-news/images/quotes.gif

189 B

wp-content/themes/hybrid-news/images/search-icon.png

174 B

wp-content/themes/hybrid-news/images/slider-next.gif

1.15 KiB

wp-content/themes/hybrid-news/images/slider-prev.gif

1.2 KiB

wp-content/themes/hybrid-news/images/trackback.jpg

1.62 KiB

wp-content/themes/hybrid-news/images/widget-title.png

265 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment