Advertisement
Guest User

AccessRealty functions.php file from Himani Lotia

a guest
Dec 29th, 2016
45
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //* Start the engine
  3. include_once( get_template_directory() . '/lib/init.php' );
  4.  
  5. //* Child theme (do not remove)
  6. define( 'CHILD_THEME_NAME', __( 'Move-in Ready Child Theme', 'move-in-ready' ) );
  7. define( 'CHILD_THEME_URL', 'http://www.agentevolution.com/shop/move-in-ready/' );
  8. define( 'CHILD_THEME_VERSION', '1.0.5' );
  9.  
  10. //* Set Localization (do not remove)
  11. load_child_theme_textdomain( 'move-in-ready', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'move-in-ready' ) );
  12.  
  13. //* Add Theme Support
  14. add_theme_support( 'equity-top-header-bar' );
  15. add_theme_support( 'equity-after-entry-widget-area' );
  16.  
  17. //* Add small 90x90 thumbnail image size
  18. add_image_size( 'mini', '90', '90', true);
  19. add_image_size( 'listings_large', '720', '410', true);
  20.  
  21. //* Create additional color style options
  22. add_theme_support( 'equity-style-selector', array(
  23. 'mir-green' => __( 'Green', 'move-in-ready' ),
  24. 'mir-red' => __( 'Red', 'move-in-ready' ),
  25. 'mir-purple' => __( 'Purple', 'move-in-ready' ),
  26. 'mir-grey' => __( 'Grey', 'move-in-ready' ),
  27. 'mir-custom' => __( 'Use Customizer', 'move-in-ready' ),
  28. ) );
  29.  
  30.  
  31. //* Load fonts
  32. add_filter( 'equity_google_fonts', 'move_in_ready_fonts' );
  33. function move_in_ready_fonts( $equity_google_fonts ) {
  34. $equity_google_fonts = 'Montserrat:700|Roboto:400,300';
  35. return $equity_google_fonts;
  36. }
  37.  
  38. //* Register new IDX Carousel widget
  39. add_action('widgets_init', 'move_in_ready_idx_carousel');
  40. function move_in_ready_idx_carousel() {
  41. if ( class_exists( 'Equity_IDX_Carousel_Widget' ) ) {
  42. unregister_widget('Equity_IDX_Carousel_Widget');
  43. require_once get_stylesheet_directory() . '/lib/widgets/Equity_MIR_IDX_Carousel_Widget.php';
  44. register_widget('Equity_MIR_IDX_Carousel_Widget');
  45. }
  46. }
  47.  
  48. //* Add top header nav
  49. add_theme_support( 'equity-menus', array( 'main' => __( 'Main Menu', 'move-in-ready' ), 'top-header-right' => __( 'Top Header Right', 'move-in-ready' ) ) );
  50.  
  51.  
  52. //* Redefine top header widget width
  53. add_filter( 'top_header_left_widget_widths', 'mir_top_header_left_width');
  54. function mir_top_header_left_width() {
  55. $top_header_left_widget_widths = 'small-12 medium-4 large-3';
  56. return $top_header_left_widget_widths;
  57. }
  58.  
  59. //* Register widget areas
  60. equity_register_widget_area(
  61. array(
  62. 'id' => 'home-top-left',
  63. 'name' => __( 'Home Top Left', 'move-in-ready' ),
  64. 'description' => __( 'This is the Top Left section of the Home page, recommended to use a slider or IDX carousel widget.', 'move-in-ready' ),
  65. )
  66. );
  67. equity_register_widget_area(
  68. array(
  69. 'id' => 'home-top-right',
  70. 'name' => __( 'Home Top Right', 'move-in-ready' ),
  71. 'description' => __( 'This is the Top Right section of the Home page, recommended to use an IDX search widget.', 'move-in-ready' ),
  72. )
  73. );
  74. equity_register_widget_area(
  75. array(
  76. 'id' => 'home-middle',
  77. 'name' => __( 'Home Middle', 'move-in-ready' ),
  78. 'description' => __( 'This is the Middle section of the Home page, recommended for calls to action using theme shortcodes.', 'move-in-ready' ),
  79. )
  80. );
  81. equity_register_widget_area(
  82. array(
  83. 'id' => 'home-bottom-left',
  84. 'name' => __( 'Home Bottom Left', 'move-in-ready' ),
  85. 'description' => __( 'This is the Bottom Left section of the Home page.', 'move-in-ready' ),
  86. )
  87. );
  88. equity_register_widget_area(
  89. array(
  90. 'id' => 'home-bottom-right',
  91. 'name' => __( 'Home Bottom Right', 'move-in-ready' ),
  92. 'description' => __( 'This is the Bottom Right section of the Home page.', 'move-in-ready' ),
  93. )
  94. );
  95.  
  96. //* Home page - define home page widget areas for welcome screen display check
  97. add_filter('equity_theme_widget_areas', 'move_in_ready_home_widget_areas');
  98. function move_in_ready_home_widget_areas($active_widget_areas) {
  99. $active_widget_areas = array( 'home-top-left', 'home-top-right', 'home-middle', 'home-bottom-left', 'home-bottom-right' );
  100. return $active_widget_areas;
  101. }
  102.  
  103. //*Hiding Page Title changed is_single() || is_page() to is_front_page()
  104. //*function wpb_hidetitle_class($classes) {
  105. //*if ( is_front_page() ) :
  106. //*$classes[] = 'hidetitle';
  107. //*return $classes;
  108. //*endif;
  109. //*return $classes;
  110. //*}
  111. //*add_filter('post_class', 'wpb_hidetitle_class');
  112.  
  113. //* Default widget content
  114. if ( ! is_active_sidebar( 'top-header-left' ) ) {
  115. add_action('equity_top_header_left', 'top_header_left_default_widget');
  116. }
  117. function top_header_left_default_widget() {
  118. the_widget( 'WP_Widget_Text', array( 'text' => '[social_icons]') );
  119. }
  120.  
  121. //* Adding Yoast Breadcrumb Functonality
  122. add_action( 'equity_before_content', 'accessrealty_add_yoast_breadcrumbs' );
  123. function accessrealty_add_yoast_breadcrumbs() {
  124.  
  125. if(function_exists('yoast_breadcrumbs')) {
  126. yoast_breadcrumb('<p id="breadcrumbs">','</p>');
  127. }
  128. }
  129.  
  130. //* Home page - markup and default widgets
  131. function equity_child_home() {
  132. ?>
  133.  
  134. <div class="home-top">
  135. <div class="row">
  136. <div class="columns small-12 large-8 home-top-left">
  137. <?php
  138. if ( ! is_active_sidebar( 'home-top-left' ) ) {
  139. the_widget( 'WP_Widget_Text', array( 'text' => 'Add an IDX Carousel widget or Slider widget here.'), array( 'before_widget' => '<aside class="widget-area">', 'after_widget' => '</aside>' ) );
  140.  
  141. } else {
  142. equity_widget_area( 'home-top-left' );
  143. }
  144. ?>
  145. </div><!-- end .columns .small-12 .large-8 .home-top-left -->
  146.  
  147. <div class="columns small-12 large-4 home-top-right">
  148. <?php
  149. if ( ! is_active_sidebar( 'home-top-right' ) ) {
  150. the_widget( 'WP_Widget_Text', array( 'title' => 'Property Search', 'text' => 'Add an IDX Search widget or WP Listings Search widget here.'), array( 'before_widget' => '<aside class="widget-area">', 'after_widget' => '</aside>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>' ) );
  151.  
  152. } else {
  153. equity_widget_area( 'home-top-right' );
  154. }
  155. ?>
  156. </div><!-- end .columns .small-12 .large-4 .home-top-right -->
  157. </div><!-- .end .row -->
  158. </div><!-- end .home-top -->
  159.  
  160. <div class="home-middle">
  161. <div class="row">
  162. <div class="columns small-12">
  163. <?php
  164. if ( ! is_active_sidebar( 'home-middle' ) ) {
  165. the_widget( 'WP_Widget_Text', array( 'text' => 'Add calls to action here using the theme\'s column and button shortcodes.'), array( 'before_widget' => '<aside class="widget-area">', 'after_widget' => '</aside>' ) );
  166. } else {
  167. equity_widget_area( 'home-middle' );
  168. }
  169. ?>
  170. </div><!-- end .columns .small-12 -->
  171. </div><!-- end .row -->
  172. </div><!-- end .home-middle -->
  173.  
  174. <div class="home-bottom">
  175. <div class="row">
  176. <div class="columns small-12 large-8 home-bottom-left">
  177. <?php
  178. if ( ! is_active_sidebar( 'home-bottom-left' ) ) {
  179. the_widget( 'WP_Widget_Text', array( 'title' => 'Our Communities', 'text' => 'Add an IDX City links widget or any other available widget(s) here.'), array( 'before_widget' => '<aside class="widget-area">', 'after_widget' => '</aside>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>' ) );
  180.  
  181. } else {
  182. equity_widget_area( 'home-bottom-left' );
  183. } ?>
  184. </div><!-- .columns .small-12 .large-8 .home-bottom-left -->
  185. <div class="columns small-12 large-4 home-bottom-right">
  186. <?php
  187. if ( ! is_active_sidebar( 'home-bottom-right' ) ) {
  188. the_widget( 'WP_Widget_Text', array( 'title' => 'Featured Blog Post', 'text' => 'Add a Featured Post widget or any other available widget(s) here.'), array( 'before_widget' => '<aside class="widget-area">', 'after_widget' => '</aside>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>' ) );
  189.  
  190. } else {
  191. equity_widget_area( 'home-bottom-right' );
  192. } ?>
  193. </div><!-- .columns .small-12 .large-4 .home-bottom-right -->
  194. </div><!-- end .row -->
  195. </div><!-- end .home-bottom -->
  196.  
  197.  
  198. <?php
  199. }
  200.  
  201. //* Includes
  202.  
  203. # Theme Customizatons
  204. require_once get_stylesheet_directory() . '/lib/customizer.php';
Advertisement
RAW Paste Data Copied
Advertisement