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( 'agency', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'parallax' ) );
- //* Add Image upload to WordPress Theme Customizer
- add_action( 'customize_register', 'parallax_customizer' );
- function parallax_customizer(){
- require_once( get_stylesheet_directory() . '/lib/customize.php' );
- }
- //* Include Section Image CSS
- include_once( get_stylesheet_directory() . '/lib/output.php' );
- //* Child theme (do not remove)
- define( 'CHILD_THEME_NAME', 'Parallax Pro Theme' );
- define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/parallax/' );
- define( 'CHILD_THEME_VERSION', '1.0' );
- //* Enqueue scripts and styles
- add_action( 'wp_enqueue_scripts', 'parallax_enqueue_scripts_styles' );
- function parallax_enqueue_scripts_styles() {
- wp_enqueue_script( 'parallax-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
- wp_enqueue_style( 'dashicons' );
- wp_enqueue_style( 'parallax-google-fonts', '//fonts.googleapis.com/css?family=Montserrat|Sorts+Mill+Goudy', array(), CHILD_THEME_VERSION );
- }
- //* Add HTML5 markup structure
- add_theme_support( 'html5' );
- //* Add viewport meta tag for mobile browsers
- add_theme_support( 'genesis-responsive-viewport' );
- //* Add support for 3-column footer widgets
- add_theme_support( 'genesis-footer-widgets', 1 );
- //* Reposition the primary navigation menu
- remove_action( 'genesis_after_header', 'genesis_do_nav' );
- add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_nav' );
- //* Reposition the secondary navigation menu
- remove_action( 'genesis_after_header', 'genesis_do_subnav' );
- add_action( 'genesis_footer', 'genesis_do_subnav', 7 );
- //* Reduce the secondary navigation menu to one level depth
- add_filter( 'wp_nav_menu_args', 'parallax_secondary_menu_args' );
- function parallax_secondary_menu_args( $args ){
- if( 'secondary' != $args['theme_location'] )
- return $args;
- $args['depth'] = 1;
- return $args;
- }
- //* Unregister layout settings
- genesis_unregister_layout( 'content-sidebar-sidebar' );
- genesis_unregister_layout( 'sidebar-content-sidebar' );
- genesis_unregister_layout( 'sidebar-sidebar-content' );
- //* Add support for additional color styles
- add_theme_support( 'genesis-style-selector', array(
- 'parallax-pro-blue' => __( 'Parallax Pro Blue', 'parallax' ),
- 'parallax-pro-green' => __( 'Parallax Pro Green', 'parallax' ),
- 'parallax-pro-orange' => __( 'Parallax Pro Orange', 'parallax' ),
- 'parallax-pro-pink' => __( 'Parallax Pro Pink', 'parallax' ),
- ) );
- //* Unregister secondary sidebar
- unregister_sidebar( 'sidebar-alt' );
- //* Add support for custom header
- add_theme_support( 'custom-header', array(
- 'width' => 360,
- 'height' => 70,
- 'header-selector' => '.site-title a',
- 'header-text' => false,
- ) );
- //* Add support for structural wraps
- add_theme_support( 'genesis-structural-wraps', array(
- 'header',
- 'nav',
- 'subnav',
- 'footer-widgets',
- 'footer',
- ) );
- //* Hook after post widget after the entry content
- add_action( 'genesis_after_entry', 'parallax_after_entry', 5 );
- function parallax_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', 'parallax_author_box_gravatar' );
- function parallax_author_box_gravatar( $size ) {
- return 176;
- }
- //* Modify the size of the Gravatar in the entry comments
- add_filter( 'genesis_comment_list_args', 'parallax_comments_gravatar' );
- function parallax_comments_gravatar( $args ) {
- $args['avatar_size'] = 120;
- return $args;
- }
- //* Register widget areas
- genesis_register_sidebar( array(
- 'id' => 'home-section-1',
- 'name' => __( 'Home Section 1', 'parallax' ),
- 'description' => __( 'This is the home section 1 section.', 'parallax' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-section-2',
- 'name' => __( 'Home Section 2', 'parallax' ),
- 'description' => __( 'This is the home section 2 section.', 'parallax' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-section-3',
- 'name' => __( 'Home Section 3', 'parallax' ),
- 'description' => __( 'This is the home section 3 section.', 'parallax' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-section-4',
- 'name' => __( 'Home Section 4', 'parallax' ),
- 'description' => __( 'This is the home section 4 section.', 'parallax' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-section-5',
- 'name' => __( 'Home Section 5', 'parallax' ),
- 'description' => __( 'This is the home section 5 section.', 'parallax' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'after-entry',
- 'name' => __( 'After Entry', 'parallax' ),
- 'description' => __( 'This is the after entry widget area.', 'parallax' ),
- ) );
- // ZELF TOEGEVOEGD
- add_theme_support( 'genesis-connect-woocommerce' );
- add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' ); // < 2.1
- add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text' ); // 2.1 +
- function woo_custom_cart_button_text() {
- return __( 'Nu Shoppen', 'woocommerce' );
- }
- add_filter( 'get_the_author_genesis_author_box_single', '__return_false' );
- // Display 24 products per page.
- add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );
- //* Modify the Genesis content limit read more link
- add_filter( 'get_the_content_more_link', 'sp_read_more_link' );
- function sp_read_more_link() {
- return '... <a class="more-link" href="' . get_permalink() . '">>>VERDER LEZEN</a>';
- }
- //* Add new featured image sizes
- add_image_size( 'blogposts', 900, 450, TRUE );
- add_image_size( 'blogposts2', 800, 300, TRUE );
- function be_home_layout( $layout ) {
- if( is_home() || is_archive() || is_single() )
- $layout = 'content-sidebar';
- return $layout;
- }
- add_filter( 'genesis_pre_get_option_site_layout', 'be_home_layout' );
- add_filter('post_class', 'grid_view_post_class');
- function grid_view_post_class( $classes ) {
- if( is_category('38')):
- $classes[] = 'one-third';
- global $wp_query;
- if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % $columns )
- $classes[] = 'first';
- endif;
- return $classes;
- }
- add_action('pre_get_posts', 'post_items');
- function post_items( $query ) {
- if( $query->is_main_query() && !is_admin() && is_category('38') ) {
- $query->set( 'posts_per_page', '9' );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement