Advertisement
Guest User

Houzz icon in functions.php

a guest
Dec 9th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.56 KB | None | 0 0
  1. <?php
  2.  
  3. global $avia_config;
  4.  
  5. /*
  6. * if you run a child theme and dont want to load the default functions.php file
  7. * set the global var below in you childthemes function.php to true:
  8. *
  9. * example: global $avia_config; $avia_config['use_child_theme_functions_only'] = true;
  10. * The default functions.php file will then no longer be loaded. You need to make sure then
  11. * to include framework and functions that you want to use by yourself.
  12. *
  13. * This is only recommended for advanced users
  14. */
  15.  
  16. if(isset($avia_config['use_child_theme_functions_only'])) return;
  17.  
  18. /*
  19. * create a global var which stores the ids of all posts which are displayed on the current page. It will help us to filter duplicate posts
  20. */
  21. $avia_config['posts_on_current_page'] = array();
  22.  
  23.  
  24. /*
  25. * wpml multi site config file
  26. * needs to be loaded before the framework
  27. */
  28.  
  29. require_once( 'config-wpml/config.php' );
  30.  
  31.  
  32. /*
  33. * These are the available color sets in your backend.
  34. * If more sets are added users will be able to create additional color schemes for certain areas
  35. *
  36. * The array key has to be the class name, the value is only used as tab heading on the styling page
  37. */
  38.  
  39.  
  40. $avia_config['color_sets'] = array(
  41. 'header_color' => 'Logo Area',
  42. 'main_color' => 'Main Content',
  43. 'alternate_color' => 'Alternate Content',
  44. 'footer_color' => 'Footer',
  45. 'socket_color' => 'Socket'
  46. );
  47.  
  48.  
  49.  
  50. /*
  51. * add support for responsive mega menus
  52. */
  53.  
  54. add_theme_support('avia_mega_menu');
  55.  
  56.  
  57.  
  58.  
  59. /*
  60. * deactivates the default mega menu and allows us to pass individual menu walkers when calling a menu
  61. */
  62.  
  63. add_filter('avia_mega_menu_walker', '__return_false');
  64.  
  65.  
  66. /*
  67. * adds support for the new avia sidebar manager
  68. */
  69.  
  70. add_theme_support('avia_sidebar_manager');
  71.  
  72. /*
  73. * Filters for post formats etc
  74. */
  75. //add_theme_support('avia_queryfilter');
  76.  
  77.  
  78.  
  79. ##################################################################
  80. # AVIA FRAMEWORK by Kriesi
  81.  
  82. # this include calls a file that automatically includes all
  83. # the files within the folder framework and therefore makes
  84. # all functions and classes available for later use
  85.  
  86. require_once( 'framework/avia_framework.php' );
  87.  
  88. ##################################################################
  89.  
  90.  
  91. /*
  92. * Register additional image thumbnail sizes
  93. * Those thumbnails are generated on image upload!
  94. *
  95. * If the size of an array was changed after an image was uploaded you either need to re-upload the image
  96. * or use the thumbnail regeneration plugin: http://wordpress.org/extend/plugins/regenerate-thumbnails/
  97. */
  98.  
  99. $avia_config['imgSize']['widget'] = array('width'=>36, 'height'=>36); // small preview pics eg sidebar news
  100. $avia_config['imgSize']['square'] = array('width'=>180, 'height'=>180); // small image for blogs
  101. $avia_config['imgSize']['featured'] = array('width'=>1500, 'height'=>430 ); // images for fullsize pages and fullsize slider
  102. $avia_config['imgSize']['featured_large'] = array('width'=>1500, 'height'=>630 ); // images for fullsize pages and fullsize slider
  103. $avia_config['imgSize']['extra_large'] = array('width'=>1500, 'height'=>1500 , 'crop' => false); // images for fullscrren slider
  104. $avia_config['imgSize']['portfolio'] = array('width'=>495, 'height'=>400 ); // images for portfolio entries (2,3 column)
  105. $avia_config['imgSize']['portfolio_small'] = array('width'=>260, 'height'=>185 ); // images for portfolio 4 columns
  106. $avia_config['imgSize']['gallery'] = array('width'=>845, 'height'=>684 ); // images for portfolio entries (2,3 column)
  107. $avia_config['imgSize']['magazine'] = array('width'=>710, 'height'=>375 ); // images for magazines
  108. $avia_config['imgSize']['masonry'] = array('width'=>705, 'height'=>705 , 'crop' => false); // images for fullscreen masonry
  109. $avia_config['imgSize']['entry_with_sidebar'] = array('width'=>845, 'height'=>321); // big images for blog and page entries
  110. $avia_config['imgSize']['entry_without_sidebar']= array('width'=>1210, 'height'=>423 ); // images for fullsize pages and fullsize slider
  111.  
  112.  
  113.  
  114. $avia_config['selectableImgSize'] = array(
  115. 'square' => __('Square','avia_framework'),
  116. 'featured' => __('Featured Thin','avia_framework'),
  117. 'featured_large' => __('Featured Large','avia_framework'),
  118. 'portfolio' => __('Portfolio','avia_framework'),
  119. 'gallery' => __('Gallery','avia_framework'),
  120. 'entry_with_sidebar' => __('Entry with Sidebar','avia_framework'),
  121. 'entry_without_sidebar' => __('Entry without Sidebar','avia_framework'),
  122. 'extra_large' => __('Fullscreen Sections/Sliders','avia_framework'),
  123.  
  124. );
  125.  
  126. avia_backend_add_thumbnail_size($avia_config);
  127.  
  128. if ( ! isset( $content_width ) ) $content_width = $avia_config['imgSize']['featured']['width'];
  129.  
  130.  
  131.  
  132.  
  133. /*
  134. * register the layout classes
  135. *
  136. */
  137.  
  138. $avia_config['layout']['fullsize'] = array('content' => 'av-content-full alpha', 'sidebar' => 'hidden', 'meta' => '','entry' => '');
  139. $avia_config['layout']['sidebar_left'] = array('content' => 'av-content-small', 'sidebar' => 'alpha' ,'meta' => 'alpha', 'entry' => '');
  140. $avia_config['layout']['sidebar_right'] = array('content' => 'av-content-small alpha','sidebar' => 'alpha', 'meta' => 'alpha', 'entry' => 'alpha');
  141.  
  142.  
  143.  
  144.  
  145.  
  146. /*
  147. * These are some of the font icons used in the theme, defined by the entypo icon font. the font files are included by the new aviaBuilder
  148. * common icons are stored here for easy retrieval
  149. */
  150.  
  151. $avia_config['font_icons'] = apply_filters('avf_default_icons', array(
  152.  
  153. //post formats + types
  154. 'standard' => array( 'font' =>'entypo-fontello', 'icon' => 'ue836'),
  155. 'link' => array( 'font' =>'entypo-fontello', 'icon' => 'ue822'),
  156. 'image' => array( 'font' =>'entypo-fontello', 'icon' => 'ue80f'),
  157. 'audio' => array( 'font' =>'entypo-fontello', 'icon' => 'ue801'),
  158. 'quote' => array( 'font' =>'entypo-fontello', 'icon' => 'ue833'),
  159. 'gallery' => array( 'font' =>'entypo-fontello', 'icon' => 'ue80e'),
  160. 'video' => array( 'font' =>'entypo-fontello', 'icon' => 'ue80d'),
  161. 'portfolio' => array( 'font' =>'entypo-fontello', 'icon' => 'ue849'),
  162. 'product' => array( 'font' =>'entypo-fontello', 'icon' => 'ue859'),
  163.  
  164. //social
  165. 'behance' => array( 'font' =>'entypo-fontello', 'icon' => 'ue915'),
  166. 'dribbble' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8fe'),
  167. 'facebook' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8f3'),
  168. 'flickr' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8ed'),
  169. 'gplus' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8f6'),
  170. 'houzz' => array( 'font' =>'entypo-fontello', 'icon' => 'ue800'),
  171. 'linkedin' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8fc'),
  172. 'instagram' => array( 'font' =>'entypo-fontello', 'icon' => 'ue909'),
  173. 'pinterest' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8f8'),
  174. 'skype' => array( 'font' =>'entypo-fontello', 'icon' => 'ue90d'),
  175. 'tumblr' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8fa'),
  176. 'twitter' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8f1'),
  177. 'vimeo' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8ef'),
  178. 'rss' => array( 'font' =>'entypo-fontello', 'icon' => 'ue853'),
  179. 'youtube' => array( 'font' =>'entypo-fontello', 'icon' => 'ue921'),
  180. 'houzz' => array( 'font' =>'fontello', 'icon' => 'ue801'),
  181. 'soundcloud' => array( 'font' =>'entypo-fontello', 'icon' => 'ue913'),
  182. 'five_100_px' => array( 'font' =>'entypo-fontello', 'icon' => 'ue802'),
  183. 'vk' => array( 'font' =>'entypo-fontello', 'icon' => 'ue926'),
  184. 'reddit' => array( 'font' =>'entypo-fontello', 'icon' => 'ue927'),
  185. 'digg' => array( 'font' =>'entypo-fontello', 'icon' => 'ue928'),
  186. 'delicious' => array( 'font' =>'entypo-fontello', 'icon' => 'ue929'),
  187. 'mail' => array( 'font' =>'entypo-fontello', 'icon' => 'ue805'),
  188.  
  189. //woocomemrce
  190. 'cart' => array( 'font' =>'entypo-fontello', 'icon' => 'ue859'),
  191. 'details' => array( 'font' =>'entypo-fontello', 'icon' => 'ue84b'),
  192.  
  193. //bbpress
  194. 'supersticky' => array( 'font' =>'entypo-fontello', 'icon' => 'ue808'),
  195. 'sticky' => array( 'font' =>'entypo-fontello', 'icon' => 'ue809'),
  196. 'one_voice' => array( 'font' =>'entypo-fontello', 'icon' => 'ue83b'),
  197. 'multi_voice' => array( 'font' =>'entypo-fontello', 'icon' => 'ue83c'),
  198. 'closed' => array( 'font' =>'entypo-fontello', 'icon' => 'ue824'),
  199. 'sticky_closed' => array( 'font' =>'entypo-fontello', 'icon' => 'ue808\ue824'),
  200. 'supersticky_closed' => array( 'font' =>'entypo-fontello', 'icon' => 'ue809\ue824'),
  201.  
  202. //navigation, slider & controls
  203. 'play' => array( 'font' =>'entypo-fontello', 'icon' => 'ue897'),
  204. 'pause' => array( 'font' =>'entypo-fontello', 'icon' => 'ue899'),
  205. 'next' => array( 'font' =>'entypo-fontello', 'icon' => 'ue879'),
  206. 'prev' => array( 'font' =>'entypo-fontello', 'icon' => 'ue878'),
  207. 'next_big' => array( 'font' =>'entypo-fontello', 'icon' => 'ue87d'),
  208. 'prev_big' => array( 'font' =>'entypo-fontello', 'icon' => 'ue87c'),
  209. 'close' => array( 'font' =>'entypo-fontello', 'icon' => 'ue814'),
  210. 'reload' => array( 'font' =>'entypo-fontello', 'icon' => 'ue891'),
  211. 'mobile_menu' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8a5'),
  212.  
  213. //image hover overlays
  214. 'ov_external' => array( 'font' =>'entypo-fontello', 'icon' => 'ue832'),
  215. 'ov_image' => array( 'font' =>'entypo-fontello', 'icon' => 'ue869'),
  216. 'ov_video' => array( 'font' =>'entypo-fontello', 'icon' => 'ue897'),
  217.  
  218.  
  219. //misc
  220. 'search' => array( 'font' =>'entypo-fontello', 'icon' => 'ue803'),
  221. 'info' => array( 'font' =>'entypo-fontello', 'icon' => 'ue81e'),
  222. 'clipboard' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8d1'),
  223. 'scrolltop' => array( 'font' =>'entypo-fontello', 'icon' => 'ue876'),
  224. 'scrolldown' => array( 'font' =>'entypo-fontello', 'icon' => 'ue877'),
  225. 'bitcoin' => array( 'font' =>'entypo-fontello', 'icon' => 'ue92a'),
  226.  
  227. ));
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234. add_theme_support( 'automatic-feed-links' );
  235.  
  236. ##################################################################
  237. # Frontend Stuff necessary for the theme:
  238. ##################################################################
  239. /*
  240. * Register theme text domain
  241. */
  242. if(!function_exists('avia_lang_setup'))
  243. {
  244. add_action('after_setup_theme', 'avia_lang_setup');
  245. function avia_lang_setup()
  246. {
  247. $lang = apply_filters('ava_theme_textdomain_path', get_template_directory() . '/lang');
  248. load_theme_textdomain('avia_framework', $lang);
  249. }
  250. }
  251.  
  252.  
  253. /*
  254. * Register frontend javascripts:
  255. */
  256. if(!function_exists('avia_register_frontend_scripts'))
  257. {
  258. if(!is_admin()){
  259. add_action('wp_enqueue_scripts', 'avia_register_frontend_scripts');
  260. }
  261.  
  262. function avia_register_frontend_scripts()
  263. {
  264. $template_url = get_template_directory_uri();
  265. $child_theme_url = get_stylesheet_directory_uri();
  266.  
  267. //register js
  268. wp_enqueue_script( 'avia-compat', $template_url.'/js/avia-compat.js', array('jquery'), 2, false ); //needs to be loaded at the top to prevent bugs
  269. wp_enqueue_script( 'avia-default', $template_url.'/js/avia.js', array('jquery'), 3, true );
  270. wp_enqueue_script( 'avia-shortcodes', $template_url.'/js/shortcodes.js', array('jquery'), 3, true );
  271. wp_enqueue_script( 'avia-popup', $template_url.'/js/aviapopup/jquery.magnific-popup.min.js', array('jquery'), 2, true);
  272.  
  273. wp_enqueue_script( 'jquery' );
  274. wp_enqueue_script( 'wp-mediaelement' );
  275.  
  276.  
  277. if ( is_singular() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }
  278.  
  279.  
  280. //register styles
  281. wp_register_style( 'avia-style' , $child_theme_url."/style.css", array(), '2', 'all' ); //register default style.css file. only include in childthemes. has no purpose in main theme
  282. wp_register_style( 'avia-custom', $template_url."/css/custom.css", array(), '2', 'all' );
  283.  
  284. wp_enqueue_style( 'avia-grid' , $template_url."/css/grid.css", array(), '2', 'all' );
  285. wp_enqueue_style( 'avia-base' , $template_url."/css/base.css", array(), '2', 'all' );
  286. wp_enqueue_style( 'avia-layout', $template_url."/css/layout.css", array(), '2', 'all' );
  287. wp_enqueue_style( 'avia-scs', $template_url."/css/shortcodes.css", array(), '2', 'all' );
  288. wp_enqueue_style( 'avia-popup-css', $template_url."/js/aviapopup/magnific-popup.css", array(), '1', 'screen' );
  289. wp_enqueue_style( 'avia-media' , $template_url."/js/mediaelement/skin-1/mediaelementplayer.css", array(), '1', 'screen' );
  290. wp_enqueue_style( 'avia-print' , $template_url."/css/print.css", array(), '1', 'print' );
  291.  
  292.  
  293. if ( is_rtl() ) {
  294. wp_enqueue_style( 'avia-rtl', $template_url."/css/rtl.css", array(), '1', 'all' );
  295. }
  296.  
  297.  
  298. global $avia;
  299. $safe_name = avia_backend_safe_string($avia->base_data['prefix']);
  300.  
  301. if( get_option('avia_stylesheet_exists'.$safe_name) == 'true' )
  302. {
  303. $avia_upload_dir = wp_upload_dir();
  304. if(is_ssl()) $avia_upload_dir['baseurl'] = str_replace("http://", "https://", $avia_upload_dir['baseurl']);
  305.  
  306. $avia_dyn_stylesheet_url = $avia_upload_dir['baseurl'] . '/dynamic_avia/'.$safe_name.'.css';
  307. $version_number = get_option('avia_stylesheet_dynamic_version'.$safe_name);
  308. if(empty($version_number)) $version_number = '1';
  309.  
  310. wp_enqueue_style( 'avia-dynamic', $avia_dyn_stylesheet_url, array(), $version_number, 'all' );
  311. }
  312.  
  313. wp_enqueue_style( 'avia-custom');
  314.  
  315.  
  316. if($child_theme_url != $template_url)
  317. {
  318. wp_enqueue_style( 'avia-style');
  319. }
  320.  
  321. }
  322. }
  323.  
  324.  
  325. if(!function_exists('avia_remove_default_video_styling'))
  326. {
  327. if(!is_admin()){
  328. add_action('wp_footer', 'avia_remove_default_video_styling', 1);
  329. }
  330.  
  331. function avia_remove_default_video_styling()
  332. {
  333. //remove default style for videos
  334. wp_dequeue_style( 'mediaelement' );
  335. // wp_dequeue_script( 'wp-mediaelement' );
  336. // wp_dequeue_style( 'wp-mediaelement' );
  337. }
  338. }
  339.  
  340.  
  341.  
  342.  
  343. /*
  344. * Activate native wordpress navigation menu and register a menu location
  345. */
  346. if(!function_exists('avia_nav_menus'))
  347. {
  348. function avia_nav_menus()
  349. {
  350. global $avia_config, $wp_customize;
  351.  
  352. add_theme_support('nav_menus');
  353.  
  354. foreach($avia_config['nav_menus'] as $key => $value)
  355. {
  356. //wp-admin\customize.php does not support html code in the menu description - thus we need to strip it
  357. $name = (!empty($value['plain']) && !empty($wp_customize)) ? $value['plain'] : $value['html'];
  358. register_nav_menu($key, THEMENAME.' '.$name);
  359. }
  360. }
  361.  
  362. $avia_config['nav_menus'] = array( 'avia' => array('html' => __('Main Menu', 'avia_framework')),
  363. 'avia2' => array(
  364. 'html' => __('Secondary Menu <br/><small>(Will be displayed if you selected a header layout that supports a submenu <a target="_blank" href="'.admin_url('?page=avia#goto_header').'">here</a>)</small>', 'avia_framework'),
  365. 'plain'=> __('Secondary Menu - will be displayed if you selected a header layout that supports a submenu', 'avia_framework')),
  366. 'avia3' => array(
  367. 'html' => __('Footer Menu <br/><small>(no dropdowns)</small>', 'avia_framework'),
  368. 'plain'=> __('Footer Menu (no dropdowns)', 'avia_framework'))
  369. );
  370.  
  371. avia_nav_menus(); //call the function immediatly to activate
  372. }
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383. /*
  384. * load some frontend functions in folder include:
  385. */
  386.  
  387. require_once( 'includes/admin/register-portfolio.php' ); // register custom post types for portfolio entries
  388. require_once( 'includes/admin/register-widget-area.php' ); // register sidebar widgets for the sidebar and footer
  389. require_once( 'includes/loop-comments.php' ); // necessary to display the comments properly
  390. require_once( 'includes/helper-template-logic.php' ); // holds the template logic so the theme knows which tempaltes to use
  391. require_once( 'includes/helper-social-media.php' ); // holds some helper functions necessary for twitter and facebook buttons
  392. require_once( 'includes/helper-post-format.php' ); // holds actions and filter necessary for post formats
  393. require_once( 'includes/helper-markup.php' ); // holds the markup logic (schema.org and html5)
  394. require_once( 'includes/admin/register-plugins.php'); // register the plugins we need
  395.  
  396. if(current_theme_supports('avia_conditionals_for_mega_menu'))
  397. {
  398. require_once( 'includes/helper-conditional-megamenu.php' ); // holds the walker for the responsive mega menu
  399. }
  400.  
  401. require_once( 'includes/helper-responsive-megamenu.php' ); // holds the walker for the responsive mega menu
  402.  
  403.  
  404.  
  405.  
  406. //adds the plugin initalization scripts that add styles and functions
  407.  
  408. if(!current_theme_supports('deactivate_layerslider')) require_once( 'config-layerslider/config.php' );//layerslider plugin
  409.  
  410. require_once( 'config-bbpress/config.php' ); //compatibility with bbpress forum plugin
  411. require_once( 'config-templatebuilder/config.php' ); //templatebuilder plugin
  412. require_once( 'config-gravityforms/config.php' ); //compatibility with gravityforms plugin
  413. require_once( 'config-woocommerce/config.php' ); //compatibility with woocommerce plugin
  414. require_once( 'config-wordpress-seo/config.php' ); //compatibility with Yoast WordPress SEO plugin
  415. require_once( 'config-events-calendar/config.php' ); //compatibility with the Events Calendar plugin
  416.  
  417.  
  418. if(is_admin())
  419. {
  420. require_once( 'includes/admin/helper-compat-update.php'); // include helper functions for new versions
  421. }
  422.  
  423.  
  424.  
  425.  
  426. /*
  427. * dynamic styles for front and backend
  428. */
  429. if(!function_exists('avia_custom_styles'))
  430. {
  431. function avia_custom_styles()
  432. {
  433. require_once( 'includes/admin/register-dynamic-styles.php' ); // register the styles for dynamic frontend styling
  434. avia_prepare_dynamic_styles();
  435. }
  436.  
  437. add_action('init', 'avia_custom_styles', 20);
  438. add_action('admin_init', 'avia_custom_styles', 20);
  439. }
  440.  
  441.  
  442.  
  443.  
  444. /*
  445. * activate framework widgets
  446. */
  447. if(!function_exists('avia_register_avia_widgets'))
  448. {
  449. function avia_register_avia_widgets()
  450. {
  451. register_widget( 'avia_newsbox' );
  452. register_widget( 'avia_portfoliobox' );
  453. register_widget( 'avia_socialcount' );
  454. register_widget( 'avia_combo_widget' );
  455. register_widget( 'avia_partner_widget' );
  456. register_widget( 'avia_google_maps' );
  457. register_widget( 'avia_fb_likebox' );
  458.  
  459.  
  460. }
  461.  
  462. avia_register_avia_widgets(); //call the function immediatly to activate
  463. }
  464.  
  465.  
  466.  
  467. /*
  468. * add post format options
  469. */
  470. add_theme_support( 'post-formats', array('link', 'quote', 'gallery','video','image','audio' ) );
  471.  
  472.  
  473.  
  474. /*
  475. * Remove the default shortcode function, we got new ones that are better ;)
  476. */
  477. add_theme_support( 'avia-disable-default-shortcodes', true);
  478.  
  479.  
  480. /*
  481. * compat mode for easier theme switching from one avia framework theme to another
  482. */
  483. add_theme_support( 'avia_post_meta_compat');
  484.  
  485.  
  486. /*
  487. * make sure that enfold widgets dont use the old slideshow parameter in widgets, but default post thumbnails
  488. */
  489. add_theme_support('force-post-thumbnails-in-widget');
  490.  
  491.  
  492.  
  493.  
  494. /*
  495. * register custom functions that are not related to the framework but necessary for the theme to run
  496. */
  497.  
  498. require_once( 'functions-enfold.php');
  499.  
  500.  
  501. /*
  502. * add option to edit elements via css class
  503. */
  504. // add_theme_support('avia_template_builder_custom_css');
  505.  
  506.  
  507. add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
  508. function avia_add_custom_icon($icons)
  509. {
  510. $icons['houzz'] = array( 'font' =>'fontello', 'icon' => 'ue801');
  511. // Add new icon here
  512. return $icons;
  513. }
  514.  
  515. add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);
  516. function avia_add_custom_social_icon($icons)
  517. {
  518. $icons['Houzz'] = 'houzz';
  519. // Add new icon here
  520. return $icons;
  521. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement