for the 600 x 100 image: You can change the names and dimensions to whatever you like. Enjoy! */ add_filter( 'image_size_names_choose', 'bigpix_custom_image_sizes' ); function bigpix_custom_image_sizes( $sizes ) { return array_merge( $sizes, array( 'bigpix-thumb-600' => '600px by 150px', 'bigpix-thumb-300' => '300px by 100px', 'slider-image' => '1280px by 500px' ) ); } /* The function above adds the ability to use the dropdown menu to select the new images sizes you have just created from within the media manager when you add media to your content blocks. If you add more image sizes, duplicate one of the lines in the array and name it according to your new image size. */ /************* ACTIVE SIDEBARS ********************/ // Sidebars & Widgetizes Areas function bigpix_register_sidebars() { register_sidebar(array( 'id' => 'sidebar3', 'name' => __( 'Homepage Menu Widget Area', 'bigpixtheme' ), 'description' => __( 'The Menu Widget Area.', 'bigpixtheme' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'sidebar1', 'name' => __( 'Posts Menu Widget Area', 'bigpixtheme' ), 'description' => __( 'The Posts Menu Widget Area.', 'bigpixtheme' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'sidebar2', 'name' => __( 'Page Menu Widget Area', 'bigpixtheme' ), 'description' => __( 'The Page Menu Widget Area.', 'bigpixtheme' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'sidebar5', 'name' => __( 'Archive Menu Widget Area', 'bigpixtheme' ), 'description' => __( 'The Archive Menu Widget Area.', 'bigpixtheme' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'sidebar4', 'name' => __( 'Footer Widget Area', 'bigpixtheme' ), 'description' => __( 'The Footer Widget Area.', 'bigpixtheme' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); /* to add more sidebars or widgetized areas, just copy and edit the above sidebar code. In order to call your new sidebar just use the following code: Just change the name to whatever your new sidebar's id is, for example: register_sidebar(array( 'id' => 'sidebar2', 'name' => __( 'Sidebar 2', 'bigpixtheme' ), 'description' => __( 'The second (secondary) sidebar.', 'bigpixtheme' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); To call the sidebar in your template, you can just copy the sidebar.php file and rename it to your sidebar's name. So using the above example, it would be: sidebar-sidebar2.php */ } // don't remove this bracket! /************* COMMENT LAYOUT *********************/ // Comment Layout function bigpix_comments( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; ?>
>
' ); */ ?>
comment_approved == '0') : ?>

%1$s %2$s', 'bigpixtheme' ), get_comment_author_link(), edit_comment_link(__( '(Edit)', 'bigpixtheme' ),' ','') ) ?>
$depth, 'max_depth' => $args['max_depth']))) ?>
is added by WordPress automatically ?> remove_section( 'title_tagline'); $wp_customize->remove_section( 'static_front_page' ); /* color scheme option */ $wp_customize->add_setting( 'BIGPIX_color_settings', array ( 'default' => '#161616', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'BIGPIX_color_settings', array( 'label' => __( 'Primary Color Scheme', 'BIGPIX' ), 'section' => 'colors', 'settings' => 'BIGPIX_color_settings', ) ) ); $wp_customize->add_setting( 'BIGPIX_color_settings_2', array ( 'default' => '#656565', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'BIGPIX_color_settings_2', array( 'label' => __( 'Secondary Color Scheme', 'BIGPIX' ), 'section' => 'colors', 'settings' => 'BIGPIX_color_settings_2', ) ) ); $wp_customize->add_setting( 'BIGPIX_color_settings_3', array ( 'default' => '#fcff00', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'BIGPIX_color_settings_3', array( 'label' => __( 'Button and link Color Scheme', 'BIGPIX' ), 'section' => 'colors', 'settings' => 'BIGPIX_color_settings_3', ) ) ); /* logo option */ $wp_customize->add_section( 'BIGPIX_logo_section' , array( 'title' => __( 'Site Logo', 'BIGPIX' ), 'priority' => 1, 'description' => __( 'Upload a logo to replace the default site name in the header', 'BIGPIX' ), ) ); $wp_customize->add_setting( 'BIGPIX_logo', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'BIGPIX_logo', array( 'label' => __( 'Choose your logo (ideal width is 100-350px and ideal height is 35-40)', 'BIGPIX' ), 'section' => 'BIGPIX_logo_section', 'settings' => 'BIGPIX_logo', ) ) ); /* favicon option */ $wp_customize->add_section( 'BIGPIX_favicon_section' , array( 'title' => __( 'Site favicon', 'BIGPIX' ), 'priority' => 2, 'description' => __( 'Upload a favicon', 'BIGPIX' ), ) ); $wp_customize->add_setting( 'BIGPIX_favicon', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'BIGPIX_favicon', array( 'label' => __( 'Choose your favicon (ideal width and height is 16x16 or 32x32)', 'BIGPIX' ), 'section' => 'BIGPIX_favicon_section', 'settings' => 'BIGPIX_favicon', ) ) ); /* social media option */ $wp_customize->add_section( 'BIGPIX_social_section' , array( 'title' => __( 'Social Media Icons', 'BIGPIX' ), 'priority' => 32, 'description' => __( 'Optional media icons in the header', 'BIGPIX' ), ) ); $wp_customize->add_setting( 'BIGPIX_facebook', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_facebook', array( 'label' => __( 'Enter your Facebook url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_facebook', 'priority' => 101, ) ) ); $wp_customize->add_setting( 'BIGPIX_twitter', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_twitter', array( 'label' => __( 'Enter your Twitter url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_twitter', 'priority' => 102, ) ) ); $wp_customize->add_setting( 'BIGPIX_google', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_google', array( 'label' => __( 'Enter your Google+ url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_google', 'priority' => 103, ) ) ); $wp_customize->add_setting( 'BIGPIX_pinterest', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_pinterest', array( 'label' => __( 'Enter your Pinterest url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_pinterest', 'priority' => 104, ) ) ); $wp_customize->add_setting( 'BIGPIX_linkedin', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_linkedin', array( 'label' => __( 'Enter your Linkedin url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_linkedin', 'priority' => 105, ) ) ); $wp_customize->add_setting( 'BIGPIX_youtube', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_youtube', array( 'label' => __( 'Enter your Youtube url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_youtube', 'priority' => 106, ) ) ); $wp_customize->add_setting( 'BIGPIX_tumblr', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_tumblr', array( 'label' => __( 'Enter your Tumblr url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_tumblr', 'priority' => 107, ) ) ); $wp_customize->add_setting( 'BIGPIX_instagram', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_instagram', array( 'label' => __( 'Enter your Instagram url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_instagram', 'priority' => 108, ) ) ); $wp_customize->add_setting( 'BIGPIX_flickr', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_flickr', array( 'label' => __( 'Enter your Flickr url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_flickr', 'priority' => 109, ) ) ); $wp_customize->add_setting( 'BIGPIX_vimeo', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_vimeo', array( 'label' => __( 'Enter your Vimeo url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_vimeo', 'priority' => 110, ) ) ); $wp_customize->add_setting( 'BIGPIX_yelp', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_yelp', array( 'label' => __( 'Enter your Yelp url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_yelp', 'priority' => 111, ) ) ); $wp_customize->add_setting( 'BIGPIX_rss', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_rss', array( 'label' => __( 'Enter your RSS url', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_rss', 'priority' => 112, ) ) ); $wp_customize->add_setting( 'BIGPIX_email', array ( 'sanitize_callback' => 'sanitize_email', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_email', array( 'label' => __( 'Enter your email address', 'BIGPIX' ), 'section' => 'BIGPIX_social_section', 'settings' => 'BIGPIX_email', 'priority' => 113, ) ) ); /* slider options */ $wp_customize->add_section( 'BIGPIX_slider_section' , array( 'title' => __( 'Slider Options', 'BIGPIX' ), 'priority' => 33, 'description' => __( 'Adjust the behavior of the image slider.', 'BIGPIX' ), ) ); $wp_customize->add_setting( 'BIGPIX_slider_effect', array( 'default' => 'scrollHorz', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( 'effect_select_box', array( 'settings' => 'BIGPIX_slider_effect', 'label' => __( 'Select Effect:', 'BIGPIX' ), 'section' => 'BIGPIX_slider_section', 'type' => 'select', 'choices' => array( 'scrollHorz' => 'Horizontal (Default)', 'scrollVert' => 'Vertical', 'tileSlide' => 'Tile Slide', 'tileBlind' => 'Blinds', 'shuffle' => 'Shuffle', ), )); $wp_customize->add_setting( 'BIGPIX_slider_timeout', array ( 'sanitize_callback' => 'BIGPIX_sanitize_integer', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'BIGPIX_slider_timeout', array( 'label' => __( 'Autoplay Speed in Seconds', 'BIGPIX' ), 'section' => 'BIGPIX_slider_section', 'settings' => 'BIGPIX_slider_timeout', ) ) ); /* author bio in posts option */ $wp_customize->add_section( 'BIGPIX_author_bio_section' , array( 'title' => __( 'Disable Author Bio', 'BIGPIX' ), 'priority' => 35, 'description' => __( 'Option to disable the author bio in the posts.', 'BIGPIX' ), ) ); $wp_customize->add_setting( 'BIGPIX_author_bio', array ( 'sanitize_callback' => 'BIGPIX_sanitize_checkbox', ) ); $wp_customize->add_control('author_bio', array( 'settings' => 'BIGPIX_author_bio', 'label' => __('Disable the Author Bio?', 'BIGPIX'), 'section' => 'BIGPIX_author_bio_section', 'type' => 'checkbox', )); /* related posts option */ $wp_customize->add_section( 'BIGPIX_related_posts_section' , array( 'title' => __( 'Disable Related Posts', 'BIGPIX' ), 'priority' => 36, 'description' => __( 'Option to disable the related posts in the posts.', 'BIGPIX' ), ) ); $wp_customize->add_setting( 'BIGPIX_related_posts', array ( 'sanitize_callback' => 'BIGPIX_sanitize_checkbox', ) ); $wp_customize->add_control('related_posts', array( 'settings' => 'BIGPIX_related_posts', 'label' => __('Disable the Related Posts?', 'BIGPIX'), 'section' => 'BIGPIX_related_posts_section', 'type' => 'checkbox', )); /*$wp_customize->add_setting( 'BIGPIX_slider_pager', array ( 'sanitize_callback' => 'BIGPIX_sanitize_checkbox', ) ); $wp_customize->add_control('enable_pager', array( 'settings' => 'BIGPIX_slider_pager', 'label' => __('Enable pager', 'BIGPIX'), 'section' => 'BIGPIX_slider_section', 'type' => 'checkbox', ));*/ /* date format options $wp_customize->add_section( 'BIGPIX_date_format_section' , array( 'title' => __( 'Date Format Options', 'BIGPIX' ), 'priority' => 34, 'description' => __( 'Adjust the date format.', 'BIGPIX' ), ) ); $wp_customize->add_setting( 'BIGPIX_date_format', array( 'default' => 'd.m.y', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( 'date_format_select_box', array( 'settings' => 'BIGPIX_date_format', 'label' => __( 'Select Format:', 'BIGPIX' ), 'section' => 'BIGPIX_date_format_section', 'type' => 'select', 'choices' => array( 'd.m.y' => '31.01.13 (DD.MM.YY)', 'm.d.y' => '01.31.13 (MM.DD.YY)', 'F d, Y' => 'January 01, 2013', ), ));*/ $wp_customize->remove_section( 'nav'); $wp_customize->remove_section( 'header_image'); $wp_customize->remove_section( 'background_image'); } endif; add_action('customize_register', 'BIGPIX_theme_customizer'); /** * Sanitize checkbox */ if ( ! function_exists( 'BIGPIX_sanitize_checkbox' ) ) : function BIGPIX_sanitize_checkbox( $input ) { if ( $input == 1 ) { return 1; } else { return ''; } } endif; /** * Sanitize integer input */ if ( ! function_exists( 'BIGPIX_sanitize_integer' ) ) : function BIGPIX_sanitize_integer( $input ) { return absint($input); } endif; /** * Apply Color Scheme */ if ( ! function_exists( 'BIGPIX_apply_color' ) ) : function BIGPIX_apply_color() { if ( get_theme_mod('BIGPIX_color_settings') ) { ?> query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; $pagination = array( 'base' => @add_query_arg('page','%#%'), 'format' => '', 'total' => $wp_query->max_num_pages, 'current' => $current, 'show_all' => true, 'type' => 'list', 'next_text' => '»', 'prev_text' => '«' ); if( $wp_rewrite->using_permalinks() ) $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 'page', get_pagenum_link( 1 ) ) ) . '?page=%#%/', 'paged' ); if( !empty($wp_query->query_vars['s']) ) $pagination['add_args'] = array( 's' => get_query_var( 's' ) ); echo paginate_links( $pagination ); } add_filter( 'the_content', 'remove_br_gallery', 11, 2); function remove_br_gallery($output) { return preg_replace('/
/mi','',$output); } function author_excerpt() { $text_limit = 50; //Words to show in author bio excerpt $read_more = "Read more"; //Read more text $end_of_txt = "..."; $name_of_author = get_the_author(); $url_of_author = get_author_posts_url(get_the_author_meta('ID')); $short_desc_author = wp_trim_words(strip_tags( get_the_author_meta('description')), $text_limit, $end_of_txt.'
'.$read_more .''); return $short_desc_author; } function catch_that_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $transformed_content = apply_filters('the_content',$post->post_content); if( $output = preg_match_all('//i', $transformed_content, $matches)){ $first_img = $matches[1][0]; } return $first_img; } /** * * This script will prompt the users to install the plugin required to * enable the "Menu Item" custom post type for magazino theme. * * @package TGM-Plugin-Activation * @subpackage Example * @version 2.3.6 * @author Thomas Griffin * @author Gary Jones * @copyright Copyright (c) 2012, Thomas Griffin * @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later * @link https://github.com/thomasgriffin/TGM-Plugin-Activation */ /** * Include the TGM_Plugin_Activation class. */ require_once dirname( __FILE__ ) . '/library/class/class-tgm-plugin-activation.php'; add_action( 'tgmpa_register', 'my_theme_register_required_plugins' ); /** * Register the required plugins for this theme. * * In this example, we register two plugins - one included with the TGMPA library * and one from the .org repo. * * The variable passed to tgmpa_register_plugins() should be an array of plugin * arrays. * * This function is hooked into tgmpa_init, which is fired within the * TGM_Plugin_Activation class constructor. */ function my_theme_register_required_plugins() { /** * Array of plugin arrays. Required keys are name and slug. * If the source is NOT from the .org repo, then source is also required. */ $plugins = array( // This is an example of how to include a plugin from the WordPress Plugin Repository. array( 'name' => 'Advanced Custom Fields', 'slug' => 'advanced-custom-fields', 'required' => false, ), ); /** * Array of configuration settings. Amend each line as needed. * If you want the default strings to be available under your own theme domain, * leave the strings uncommented. * Some of the strings are added into a sprintf, so see the comments at the * end of each line for what each argument will be. */ $config = array( 'default_path' => '', // Default absolute path to pre-packaged plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. 'strings' => array( 'page_title' => __( 'Install Required Plugins', 'tgmpa' ), 'menu_title' => __( 'Install Plugins', 'tgmpa' ), 'installing' => __( 'Installing Plugin: %s', 'tgmpa' ), // %s = plugin name. 'oops' => __( 'Something went wrong with the plugin API.', 'tgmpa' ), 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s). 'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s). 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s). 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s). 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s). 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s). 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), 'return' => __( 'Return to Required Plugins Installer', 'tgmpa' ), 'plugin_activated' => __( 'Plugin activated successfully.', 'tgmpa' ), 'complete' => __( 'All plugins installed and activated successfully. %s', 'tgmpa' ), // %s = dashboard link. 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. ) ); tgmpa( $plugins, $config ); } /* DON'T DELETE THIS CLOSING TAG */ ?>