36, 'height'=>36 ); // small preview pics eg sidebar news $avia_config['imgSize']['post-format-image'] = array('width'=>630, 'height'=>999, 'crop'=>false); // big images for post format image and gallery posts $avia_config['imgSize']['fullsize'] = array('width'=>930, 'height'=>930, 'crop'=>false); // big images for lightbox and portfolio single entries $avia_config['imgSize']['featured'] = array('width'=>930, 'height'=>340); // images for fullsize pages and fullsize slider $avia_config['imgSize']['portfolio'] = array('width'=>450, 'height'=>335); // images for portfolio entries (2,3,4 column) //dynamic columns $avia_config['imgSize']['dynamic_1'] = array('width'=>446, 'height'=>151); // images for 2/4 (aka 1/2) dynamic portfolio columns when using 3 columns $avia_config['imgSize']['dynamic_2'] = array('width'=>609, 'height'=>210); // images for 2/3 dynamic portfolio columns $avia_config['imgSize']['dynamic_3'] = array('width'=>688, 'height'=>151); // images for 3/4 dynamic portfolio columns avia_backend_add_thumbnail_size($avia_config); ################################################################## # Frontend Stuff necessary for the theme: ################################################################## $lang = TEMPLATEPATH . '/lang'; load_theme_textdomain('avia_framework', $lang); /* Register frontend javascripts: */ if(!is_admin()){ add_action('init', 'avia_frontend_js'); } if(!function_exists('avia_frontend_js')) { function avia_frontend_js() { wp_register_script( 'avia-default', AVIA_BASE_URL.'js/avia.js', array('jquery','avia-html5-video'), 1, false ); wp_register_script( 'avia-prettyPhoto', AVIA_BASE_URL.'js/prettyPhoto/js/jquery.prettyPhoto.js', 'jquery', "3.0.1", true); wp_register_script( 'avia-html5-video', AVIA_BASE_URL.'js/projekktor/projekktor.min.js', 'jquery', "1", true); wp_register_script( 'adaptavia-slider', AVIA_BASE_URL.'js/adaptavia.js', 'jquery', "1.0.0", true); } } /* Activate native wordpress navigation menu and register a menu location */ add_theme_support('nav_menus'); $avia_config['nav_menus'] = array('avia' => 'Main Menu', 'avia2'=> 'Sub Menu'); foreach($avia_config['nav_menus'] as $key => $value){ register_nav_menu($key, THEMENAME.' '.$value); } //adds the plugin initalization scripts that add styles and functions require_once( 'config-woocommerce/config.php' ); //woocommerce shop plugin require_once( 'config-bbpress/config.php' ); //bbpress forum plugin //load some frontend functions in folder include: require_once( 'includes/admin/register-portfolio.php' ); // register custom post types for portfolio entries require_once( 'includes/admin/register-widget-area.php' ); // register sidebar widgets for the sidebar and footer require_once( 'css/dynamic-css.php' ); // register the styles for dynamic frontend styling require_once( 'includes/admin/register-shortcodes.php' ); // register wordpress shortcodes require_once( 'includes/loop-comments.php' ); // necessary to display the comments properly require_once( 'includes/helper-slideshow.php' ); // holds the class that generates the 2d & 3d slideshows, as well as feature images require_once( 'includes/helper-templates.php' ); // holds some helper functions necessary for dynamic templates require_once( 'includes/admin/compat.php' ); // compatibility functions for 3rd party plugins require_once( 'includes/admin/register-plugins.php'); // register the plugins we need //activate framework widgets register_widget( 'avia_tweetbox'); register_widget( 'avia_newsbox' ); register_widget( 'avia_portfoliobox' ); register_widget( 'avia_socialcount' ); register_widget( 'avia_combo_widget' ); register_widget( 'avia_partner_widget' ); //add post format options add_theme_support( 'post-formats', array('link', 'quote', 'gallery' ) ); ###################################################################### # CUSTOM THEME FUNCTIONS ###################################################################### //call functions for the theme add_filter('the_content_more_link', 'avia_remove_more_jump_link'); add_post_type_support('page', 'excerpt'); //allow mp4, webm and ogv file uploads add_filter('upload_mimes','avia_upload_mimes'); function avia_upload_mimes($mimes){ return array_merge($mimes, array ('mp4' => 'video/mp4', 'ogv' => 'video/ogg', 'webm' => 'video/webm')); } //change default thumbnail size on theme activation add_action('avia_backend_theme_activation', 'avia_set_thumb_size'); function avia_set_thumb_size() {update_option( 'thumbnail_size_h', 80 ); update_option( 'thumbnail_size_w', 80 );} //remove post thumbnails from page and posts add_theme_support( 'post-thumbnails' ); add_action('posts_selection', 'avia_remove_post_thumbnails'); add_action('init', 'avia_remove_post_thumbnails'); if(!function_exists('avia_remove_post_thumbnails')) { function avia_remove_post_thumbnails() { global $post_type; $remove_when = array('post','page','portfolio','product'); if(is_admin()) { foreach($remove_when as $remove) { if($post_type == $remove || (isset($_GET['post_type']) && $_GET['post_type'] == $remove)) { remove_theme_support( 'post-thumbnails' ); }; } } } } /*advanced title + breadcrumb function*/ if(!function_exists('avia_title')) { function avia_title($title = "", $product = "", $meta = true) { if(is_object($title)) $title = $title->post_title; if(!$title) $title = get_the_title(avia_get_the_id()); $extraClass = ""; if(!$meta) $extraClass = "no_padding_title"; echo "