Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //* Start the engine
- include_once( get_template_directory() . '/lib/init.php' );
- //* Set Localization (do not remove)
- load_child_theme_textdomain( 'lifestyle', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'lifestyle' ) );
- //* Child theme (do not remove)
- define( 'CHILD_THEME_NAME', __( 'Lifestyle Pro Theme', 'lifestyle' ) );
- define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/lifestyle/' );
- define( 'CHILD_THEME_VERSION', '3.0.0' );
- //* Add HTML5 markup structure
- add_theme_support( 'html5' );
- //* Add viewport meta tag for mobile browsers
- add_theme_support( 'genesis-responsive-viewport' );
- //* Enqueue Droid Sans and Roboto Slab Google fonts
- add_action( 'wp_enqueue_scripts', 'lifestyle_google_fonts' );
- function lifestyle_google_fonts() {
- wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Droid+Sans:400,700|Roboto+Slab:400,300,700', array(), CHILD_THEME_VERSION );
- }
- //* Add new image sizes
- add_image_size( 'home-large', 634, 360, TRUE );
- add_image_size( 'home-small', 266, 160, TRUE );
- function output_text() {
- ?>
- <h1 id="titleheader">Engaging stories of love, joy, comfort and friendship with proven scrumptious, healthy recipes, we celebrate LOVE as the secret ingredient for wonderful food! </h1>
- <?php }
- add_action('genesis_before_loop', 'output_text');
- //* Add support for custom background
- add_theme_support( 'custom-background', array(
- 'default-image' => get_stylesheet_directory_uri() . '/images/bg.png',
- 'default-color' => 'efefe9',
- ) );
- //* Add support for custom header
- add_theme_support( 'custom-header', array(
- 'header_image' => '',
- 'header-selector' => '.site-title a',
- 'header-text' => true,
- 'height' => 260,
- 'width' => 960,
- ) );
- /**
- * Genesis Custom Header
- *
- * @author Geoffrey Rickaby
- * @since 1.8.0
- *
- */
- remove_action('genesis_header', 'genesis_do_header');
- remove_action('genesis_header', 'genesis_header_markup_open', 5);
- remove_action('genesis_header', 'genesis_header_markup_close', 15);
- function custom_header() {
- ?>
- <div id="header">
- <div class="h-wrap">
- <a href="<?=get_bloginfo('home'); ?>" alt="<?php print get_bloginfo('name') .' - '. get_bloginfo('description'); ?>">
- <img src="<?=get_bloginfo('stylesheet_directory'); ?>/images/logo.png" title="<?php print get_bloginfo('name') .' - '. get_bloginfo('description'); ?>"></a>
- </div>
- </div>
- <?php }
- add_action('genesis_header', 'custom_header');
- //* Add support for additional color style options
- add_theme_support( 'genesis-style-selector', array(
- 'lifestyle-pro-blue' => __( 'Lifestyle Pro Blue', 'lifestyle' ),
- 'lifestyle-pro-green' => __( 'Lifestyle Pro Green', 'lifestyle' ),
- 'lifestyle-pro-mustard' => __( 'Lifestyle Pro Mustard', 'lifestyle' ),
- 'lifestyle-pro-purple' => __( 'Lifestyle Pro Purple', 'lifestyle' ),
- 'lifestyle-pro-red' => __( 'Lifestyle Pro Red', 'lifestyle' ),
- ) );
- //* Add support for 3-column footer widgets
- add_theme_support( 'genesis-footer-widgets', 3 );
- remove_action( 'genesis_footer', 'genesis_do_footer' );
- add_action( 'genesis_footer', 'sp_custom_footer' );
- function sp_custom_footer() {
- ?>
- <p>· All Rights Reserved ·<a href="http://lovethesecretingredient.net/about/disclaimer/">© 2011-2014 Love- <span class="secret">the secret ingredient</span>. All rights reserved. Disclaimer |</a>
- <a href="http://lovethesecretingredient.net/about/privacy-policy/">Privacy Policy</a>
- <a href="http://lovethesecretingredient.net/about/disclosure-policy/">Disclosure Policy</a>
- <a href="http://lovethesecretingredient.net/about/terms-conditions/">Terms & Conditions</a></p>
- <?php
- }
- //* RELATED POSTS
- add_image_size( 'related', 140, 140, true );
- //for XHTML themes
- add_action( 'genesis_after_entry_content', 'child_related_posts' );
- function child_related_posts() {
- if ( is_single ( ) ) {
- global $post;
- $count = 0;
- $postIDs = array( $post->ID );
- $related = '';
- $tags = wp_get_post_tags( $post->ID );
- $cats = wp_get_post_categories( $post->ID );
- if ( $tags ) {
- foreach ( $tags as $tag ) {
- $tagID[] = $tag->term_id;
- }
- $args = array(
- 'tag__in' => $tagID,
- 'post__not_in' => $postIDs,
- 'showposts' => 5,
- 'ignore_sticky_posts' => 1,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'post_format',
- 'field' => 'slug',
- 'terms' => array(
- 'post-format-link',
- 'post-format-status',
- 'post-format-aside',
- 'post-format-quote'
- ),
- 'operator' => 'NOT IN'
- )
- )
- );
- $tag_query = new WP_Query( $args );
- if ( $tag_query->have_posts() ) {
- while ( $tag_query->have_posts() ) {
- $tag_query->the_post();
- $img = genesis_get_image() ? genesis_get_image( array( 'size' => 'related' ) ) : '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/related.png" alt="' . get_the_title() . '" />';
- $related .= '<li><a href="' . get_permalink() . '" rel="bookmark" title="Permanent Link to' . get_the_title() . '">' . $img . get_the_title() . '</a></li>';
- $postIDs[] = $post->ID;
- $count++;
- }
- }
- }
- if ( $count <= 4 ) {
- $catIDs = array( );
- foreach ( $cats as $cat ) {
- if ( 3 == $cat )
- continue;
- $catIDs[] = $cat;
- }
- $showposts = 5 - $count;
- $args = array(
- 'category__in' => $catIDs,
- 'post__not_in' => $postIDs,
- 'showposts' => $showposts,
- 'ignore_sticky_posts' => 1,
- 'orderby' => 'rand',
- 'tax_query' => array(
- array(
- 'taxonomy' => 'post_format',
- 'field' => 'slug',
- 'terms' => array(
- 'post-format-link',
- 'post-format-status',
- 'post-format-aside',
- 'post-format-quote' ),
- 'operator' => 'NOT IN'
- )
- )
- );
- $cat_query = new WP_Query( $args );
- if ( $cat_query->have_posts() ) {
- while ( $cat_query->have_posts() ) {
- $cat_query->the_post();
- $img = genesis_get_image() ? genesis_get_image( array( 'size' => 'related' ) ) : '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/related.png" alt="' . get_the_title() . '" />';
- $related .= '<li><a href="' . get_permalink() . '" rel="bookmark" title="Permanent Link to' . get_the_title() . '">' . $img . get_the_title() . '</a></li>';
- }
- }
- }
- if ( $related ) {
- printf( '<div class="related-posts"><h3 class="related-title">You might also like:</h3><ul class="related-list">%s</ul></div>', $related );
- }
- wp_reset_query();
- }
- }
- //* Reposition the primary navigation
- remove_action( 'genesis_before_header', 'genesis_do_nav' );
- add_action( 'genesis_after_header', 'genesis_do_nav' );
- //* Hook after post widget after the entry content
- add_action( 'genesis_after_entry', 'lifestyle_after_entry', 5 );
- function lifestyle_after_entry() {
- if ( is_singular( 'post' ) )
- genesis_widget_area( 'after-entry', array(
- 'before' => '<div class="after-entry widget-area">',
- 'after' => '</div>',
- ) );
- }
- //* Modify the size of the Gravatar in the author box
- add_filter( 'genesis_author_box_gravatar_size', 'lifestyle_author_box_gravatar' );
- function lifestyle_author_box_gravatar( $size ) {
- return 96;
- }
- //* Modify the size of the Gravatar in the entry comments
- add_filter( 'genesis_comment_list_args', 'lifestyle_comments_gravatar' );
- function lifestyle_comments_gravatar( $args ) {
- $args['avatar_size'] = 60;
- return $args;
- }
- //* Remove comment form allowed tags
- add_filter( 'comment_form_defaults', 'lifestyle_remove_comment_form_allowed_tags' );
- function lifestyle_remove_comment_form_allowed_tags( $defaults ) {
- $defaults['comment_notes_after'] = '';
- return $defaults;
- }
- //* Repositioning the Comments form
- remove_action( 'genesis_comments', 'genesis_do_comments' );
- add_action( 'genesis_after_comment_form', 'genesis_do_comments' );
- //* Register widget areas
- genesis_register_sidebar( array(
- 'id' => 'home-top',
- 'name' => __( 'Home - Top', 'lifestyle' ),
- 'description' => __( 'This is the top section of the homepage.', 'lifestyle' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-middle',
- 'name' => __( 'Home - Middle', 'lifestyle' ),
- 'description' => __( 'This is the middle section of the homepage.', 'lifestyle' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-bottom-left',
- 'name' => __( 'Home - Bottom Left', 'lifestyle' ),
- 'description' => __( 'This is the bottom left section of the homepage.', 'lifestyle' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-bottom-right',
- 'name' => __( 'Home - Bottom Right', 'lifestyle' ),
- 'description' => __( 'This is the bottom right section of the homepage.', 'lifestyle' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'after-entry',
- 'name' => __( 'After Entry', 'lifestyle' ),
- 'description' => __( 'This is the after entry widget area.', 'lifestyle' ),
- ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement