Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Custom amendments for the theme.
- *
- * @category Innovative
- * @subpackage Genesis
- * @copyright Copyright (c) 2013, Jessica Barnard
- * @license GPL-2.0+
- * @link http://thepixelista.com/themes/innovative/
- * @since 2.0.0
- *
- */
- add_action( 'genesis_setup', 'innovative_theme_setup', 15 );
- /**
- * Theme Setup
- *
- * This setup function attaches all of the site-wide functions
- * to the correct hooks and filters. All the functions themselves
- * are defined below this setup function.
- *
- * @since 2.0.0
- */
- function innovative_theme_setup() {
- //* Child theme (do not remove)
- define( 'CHILD_THEME_NAME', __( 'Innovative', 'innovative' ) );
- define( 'CHILD_THEME_VERSION', '2.0.0' );
- define( 'CHILD_THEME_URL', 'http://thepixelista.com/themes/innovative' );
- define( 'CHILD_THEME_DEVELOPER', __( 'The Pixelista', 'innovative' ) );
- //* Set content width for embeds.
- $content_width = apply_filters( 'content_width', 470, 400, 910 );
- //* Add viewport meta tag for mobile browsers.
- add_theme_support( 'genesis-responsive-viewport' );
- //* Add HTML5 markup structure.
- add_theme_support( 'html5' );
- //* Add new image sizes.
- add_image_size( 'home-bottom', 163, 245, true );
- add_image_size( 'home-middle', 265, 150, true );
- add_image_size( 'home-mini', 80, 80, true );
- add_image_size( 'home-supermini', 70, 48, true );
- add_image_size( 'primary-sidebar', 290, 150, true );
- //* Create additional color style options.
- add_theme_support( 'genesis-style-selector',
- array(
- 'innovative-yellow' => 'Yellow & Orange',
- 'innovative-turquoise' => 'Turquoise & Red',
- )
- );
- //* Add support for structural wraps.
- add_theme_support( 'genesis-structural-wraps',
- array(
- 'header',
- 'nav',
- 'subnav',
- 'inner',
- 'footer-widgets',
- 'footer'
- )
- );
- //* Add support for custom background.
- add_theme_support( 'custom-background' );
- //* Reposition the primary navigation.
- remove_action( 'genesis_after_header', 'genesis_do_nav' );
- add_action( 'genesis_before_header', 'genesis_do_nav' );
- //* Customize the post info function.
- add_filter( 'genesis_post_info', 'innovative_post_info_filter' );
- //* Customize the post meta function.
- add_filter( 'genesis_post_meta', 'innovative_post_meta_filter' );
- //* Customize search button text.
- add_filter( 'genesis_search_button_text', 'innovative_search_button_text' );
- //* Change the comment form arguments.
- add_filter( 'comment_form_defaults', 'innovative_comment_text' );
- //* Remove the archive thumbnail from the blog page.
- add_action( 'genesis_before_content', 'innovative_conditional_actions' );
- //* Load Google fonts.
- add_action( 'wp_enqueue_scripts', 'innovative_load_google_fonts' );
- //* Load Theme Scripts.
- add_action( 'wp_enqueue_scripts', 'innovative_load_javascript' );
- //* Load Theme Sidebars.
- innovative_sidebars();
- //* Add support for 4-column footer widgets.
- add_theme_support( 'genesis-footer-widgets', 4 );
- //* Modify the footer output.
- add_filter( 'genesis_footer_creds_text', 'innovative_footer_creds_text', 12 );
- }
- /**
- * Load Genesis
- *
- * This is technically not needed.
- * However, to make functions.php snippets useful, it is necessary.
- */
- require_once( get_template_directory() . '/lib/init.php' );
- /**
- * Register a custom callback to style the custom header.
- *
- * @since 2.0.0
- */
- function innovative_admin_style() {
- $headimg = sprintf( '.site-header { background: url(%s) no-repeat center; min-height: %spx; }', get_header_image(), HEADER_IMAGE_HEIGHT );
- printf( '<style type="text/css">%1$s</style>', $headimg );
- }
- /**
- * Modify the post info output.
- *
- * @since 2.0.0
- */
- function innovative_post_info_filter( $post_info ) {
- return '[post_date] · by [post_author_posts_link] · [post_comments] [post_edit]';
- }
- /**
- * Modify the post meta output.
- *
- * @since 2.0.0
- */
- function innovative_post_meta_filter( $post_meta ) {
- return '[post_categories before="Filed Under: "] · [post_tags before="Tagged: "]';
- }
- /**
- * Modify the search button text.
- *
- * @since 2.0.0
- */
- function innovative_search_button_text( $text ) {
- return esc_attr( 'Search' );
- }
- /**
- * Change the comment form arguments.
- *
- * @since 2.0.0
- */
- function innovative_comment_text( $args ) {
- $args['title_reply'] = __( 'Speak Your Mind', 'innovative' );
- $args['comment_notes_before'] = '';
- $args['comment_notes_after'] = '';
- return $args;
- }
- /**
- * Disable post image on archives.
- *
- * @since 2.0.0
- */
- function innovative_conditional_actions() {
- if( is_page_template( 'page_blog.php' ) && 'full' == genesis_get_option( 'content_archive' ) )
- remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
- }
- /**
- * Register and enqueue Google Fonts.
- *
- * @since 2.0.0
- */
- function innovative_load_google_fonts() {
- wp_enqueue_style( 'innovative-google-fonts', 'http://fonts.googleapis.com/css?family=Rochester', array(), CHILD_THEME_VERSION );
- }
- /**
- * Register and enqueue JavaScript Files.
- *
- * @since 2.0.0
- */
- function innovative_load_javascript() {
- wp_enqueue_script( 'innovative-mobile-menu', get_stylesheet_directory_uri() . '/js/mobile-menu.js', array('jquery'), CHILD_THEME_VERSION, true );
- }
- /**
- * Registers sidebars for Innovative theme.
- *
- * @since 2.0.0
- */
- function innovative_sidebars() {
- genesis_register_sidebar( array(
- 'id' => 'home-top',
- 'name' => __( 'Home Top', 'innovative' ),
- 'description' => __( 'This is the home top section.', 'innovative' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-left',
- 'name' => __( 'Home Left', 'innovative' ),
- 'description' => __( 'This is the home left section.', 'innovative' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-right',
- 'name' => __( 'Home Right', 'innovative' ),
- 'description' => __( 'This is the home right section.', 'innovative' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-bottom',
- 'name' => __( 'Home Bottom', 'innovative' ),
- 'description' => __( 'This is the home bottom section.', 'innovative' ),
- ) );
- }
- /**
- * Customize the Credits Text
- *
- * @param string $creds_text Default Credits.
- * @return string Modified Pixelista Credits.
- *
- * @since 2.0.0
- */
- function innovative_footer_creds_text( $creds ) {
- return sprintf(
- '[footer_copyright before="%s "] | [footer_childtheme_link before=""] %s <a href="http://thepixelista.com">%s</a> | %s [footer_genesis_link url="http://www.studiopress.com/" before=""]',
- __( 'Copyright', 'innovative' ),
- __( 'by', 'innovative' ),
- CHILD_THEME_DEVELOPER,
- __( 'Built on the ', 'innovative' )
- );
- return $output;
- }
- add_filter( 'the_content', 'add_related_posts_after_post_content' );
- function add_related_posts_after_post_content( $content ) {
- //check if it's a single post page.
- if ( is_single() ) {
- // check if we're inside the main loop
- if ( in_the_loop() && is_main_query() ) {
- // use your own shortcode attributes here
- $shortcode = '[related_posts_by_tax posts_per_page="6" format="thumbnails" image_size="medium" columns="2"]';
- // add the shortcode to the content
- $content .= do_shortcode( $shortcode );
- }
- }
- return $content;
- }
Advertisement
Add Comment
Please, Sign In to add comment