Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** Start the engine */
- require_once( get_template_directory() . '/lib/init.php' );
- /** Child theme (do not remove) */
- define( 'CHILD_THEME_NAME', 'eleven40 theme' );
- define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/eleven40' );
- /** Add Viewport meta tag for mobile browsers */
- add_action( 'genesis_meta', 'eleven40_viewport_meta_tag' );
- function eleven40_viewport_meta_tag() {
- echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
- }
- /** Add new image sizes */
- add_image_size( 'grid-thumbnail', 270, 100, TRUE );
- /** Create additional color style options */
- add_theme_support( 'genesis-style-selector', array(
- 'eleven40-blue' => 'Blue',
- 'eleven40-green' => 'Green',
- 'eleven40-red' => 'Red'
- ) );
- /** Add support for structural wraps */
- add_theme_support( 'genesis-structural-wraps', array(
- 'header',
- 'nav',
- 'subnav',
- 'inner',
- 'footer-widgets',
- 'footer'
- ) );
- /** Add the page title section */
- add_action( 'genesis_before_content_sidebar_wrap', 'eleven40_page_title' );
- function eleven40_page_title() {
- genesis_widget_area( 'page-title', array(
- 'before' => '<div class="page-title widget-area">',
- ) );
- }
- /** Add the after post section */
- add_action( 'genesis_after_post_content', 'eleven40_after_post' );
- function eleven40_after_post() {
- if ( ! is_singular( 'post' ) )
- return;
- genesis_widget_area( 'after-post', array(
- 'before' => '<div class="after-post widget-area">',
- ) );
- }
- /** Add 3-column footer widgets */
- add_theme_support( 'genesis-footer-widgets', 3 );
- /** Register widget areas */
- genesis_register_sidebar( array(
- 'id' => 'page-title',
- 'name' => __( 'Page Title', 'eleven40' ),
- 'description' => __( 'This is the page title section.', 'eleven40' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'after-post',
- 'name' => __( 'After Post', 'eleven40' ),
- 'description' => __( 'This is the after post section.', 'eleven40' ),
- ) );
- /** Modify the Genesis content limit read more link */
- add_filter( 'the_content_more_link', 'custom_read_more_link' );
- add_filter( 'get_the_content_more_link', 'custom_read_more_link' );
- function custom_read_more_link() {
- return ' . . . <a class="more-link" href="' . get_permalink() . '">(More)</a>';
- }
- /** Customize the next page link */
- add_filter ( 'genesis_next_link_text' , 'custom_next_link_text' );
- function custom_next_link_text ( $text ) {
- return g_ent( '»' ) . __( '', CHILD_DOMAIN );
- }
- /** Customize the previous page link */
- add_filter ( 'genesis_prev_link_text' , 'custom_prev_link_text' );
- function custom_prev_link_text ( $text ) {
- return g_ent( '«' ) . __( '', CHILD_DOMAIN );
- }
- /** Customize the comment submit button text */
- add_filter( 'genesis_comment_form_args', 'custom_comment_submit_button' );
- function custom_comment_submit_button( $args ) {
- $args['label_submit'] = __( 'Send to the Moose', 'apparition' );
- return $args;
- }
- /** Modify the comment link text */
- add_filter( 'genesis_post_info', 'post_info_filter' );
- function post_info_filter( $post_info ) {
- return '[post_comments zero="Comment" one="1 Comment" more="% Comments"]';
- }
- /** Customize the post meta function */
- add_filter( 'genesis_post_meta', 'post_meta_filter' );
- function post_meta_filter($post_meta) {
- if ( !is_page() ) {
- $post_meta = '[post_categories before=""] [post_tags before="Tagged: "]';
- return $post_meta;
- }}
- /** Customize the comments avatar size */
- add_filter( 'genesis_comment_list_args', 'childtheme_comment_list_args' );
- function childtheme_comment_list_args( $args ) {
- $args['avatar_size'] = 85;
- return $args;
- }
- /** Social sharing function */
- add_action( 'genesis_after_post_content', 'child_social_media_icons', 5 );
- function child_social_media_icons() {
- if ( is_home() || is_single() ) {
- if ( get_query_var( 'paged' ) >= 2 )
- return;
- ?>
- <div class="share-love">
- <div class="facebook"><a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" title="Share on Facebook.">Facebook</a></div>
- <div class="google"><a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">Google+</a></div>
- <div class="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); echo $url; ?>">Pinterest</a></div>
- <div class="stumble"><a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" title="Stumble it">Stumble</a></div>
- <div class="twitter"><a href="http://twitter.com/home/?status=<?php the_title(); ?> - <?php the_permalink(); ?>" title="Tweet this!">Twitter</a></div>
- </div>
- <?php } }
- /** Remove Twitter Pro Hashtag Links */
- function range_no_hashtag_links() {
- $wpTwitterWidget = wpTwitterWidget::getInstance();
- remove_filter( 'widget_twitter_content', array( $wpTwitterWidget, 'linkHashtags' ) );
- }
- add_action( 'init', 'range_no_hashtag_links' );
- /** Custom Widget */
- // Register Custom Widget
- genesis_register_sidebar( array(
- 'id' => 'custom-widget',
- 'name' => __( 'Custom Widget', 'eleven40' ),
- 'description' => __( 'Displays Custom Widget Content Home & Archive Pages', 'eleven40' ),
- ) );
- // Hook In Custom Widget
- add_action( 'genesis_after_post_content', 'wpsites_custom_widget', 9 );
- /**
- * @author Brad Dalton
- * @link http://wpsites.net/
- */
- function wpsites_custom_widget() {
- if ( is_home() || is_single() ) {
- if ( get_query_var( 'paged' ) >= 2 )
- return;
- echo '<div class="custom-widget"><div class="wrap">';
- dynamic_sidebar( 'custom-widget' );
- echo '</div></div>';
- }
- }
- /** Customize the post info function */
- add_filter( 'genesis_post_info', 'post_info_filter' );
- function post_info_filter($post_info) {
- if ( !is_page() ) {
- $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
- return $post_info;
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement