forked from idxbroker/Equity-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
145 lines (124 loc) · 4.78 KB
/
front-page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
/**
* Equity Framework
*
* WARNING: This file is part of the core Equity Framework. DO NOT edit this file under any circumstances.
* Please do all modifications in the form of a child theme.
*
* @package Equity\Templates
* @author IDX, LLC
* @license GPL-2.0+
* @link
*/
if ( 'posts' == get_option( 'show_on_front' ) ) {
add_filter( 'equity_pre_get_option_site_layout', '__equity_return_full_width_content' );
add_action( 'equity_meta', 'equity_home_meta' );
/**
* If no widget areas are active, display default welcome screen
*/
function equity_home_meta() {
remove_action( 'equity_loop', 'equity_do_loop' );
//* Setup widget areas to check for active sidebars
//* Define in child theme for homepage widget areas
$active_widget_areas = array();
$active_widget_areas = apply_filters( 'equity_theme_widget_areas', $active_widget_areas );
//* If child theme, add body class, and do equity_child_home() action
if ( is_child_theme() ) {
add_filter( 'body_class', 'equity_custom_home_page_body_class' );
add_action( 'equity_loop', 'equity_child_home' );
}
//* Display Welcome screen if no defined sidebars from $active_widget_areas have widgets
if ( ! equity_any_sidebar_is_active($active_widget_areas) ) {
if( ! is_child_theme() ) {
add_action( 'equity_before_content_sidebar_wrap', 'equity_welcome_lead' );
}
add_action( 'equity_loop', 'equity_welcome_screen' );
}
}
/**
* Add custom-home-page body class if homepage widget areas are active
*/
function equity_custom_home_page_body_class( $classes ) {
$classes[] = 'custom-home-page';
return $classes;
}
/**
* Output default welcome lead image/content
* Only displayed in parent theme
*/
function equity_welcome_lead() {
?>
<div class="home-lead small-12" data-stellar-background-ratio=".4" data-stellar-horizontal-offset="50%">
<div class="row">
<div class="columns small-12 medium-12 large-5 text">
<h2>Equity</h2>
<p><?php _e('The most advanced WordPress theme framework for real estate.', 'equity'); ?></p>
</div>
<div class="columns small-12 medium-4 large-2 large-offset-1">
<i class="fas fa-fw fa-mobile"></i>
<p><?php _e('Phone', 'equity'); ?></p>
</div>
<div class="columns small-12 medium-4 large-2">
<i class="fas fa-fw fa-tablet"></i>
<p><?php _e('Tablet', 'equity'); ?></p>
</div>
<div class="columns small-12 medium-4 large-2">
<i class="fas fa-fw fa-laptop"></i>
<p><?php _e('Desktop', 'equity'); ?></p>
</div>
</div><!-- end .home-lead -->
</div><!-- end .row -->
<?php
}
/**
* Output default welcome screen content
* Set $welcome to false in child theme to not display welcome content
* Ex:
* add_filter( 'equity_display_welcome_screen', 'equity_no_welcome' );
* function equity_no_welcome() {
* return false;
* }
*/
function equity_welcome_screen() {
$welcome = apply_filters( 'equity_display_welcome_screen', true );
if ( $welcome == false )
return;
wp_enqueue_style( 'equity-welcome-css' );
?>
<div class="welcome row">
<?php if(is_child_theme()) { ?>
<h2><?php echo CHILD_THEME_NAME; ?></h2>
<?php } ?>
<h3><?php _e('Get Started', 'equity'); ?></h3>
<div class="columns small-12 large-4 configure-theme">
<i class="fas fa-fw fa-gears"></i>
<h5><?php _e('Configure', 'equity'); ?></h5>
<ul>
<li><a href="<?php echo admin_url(); ?>customize.php"><?php _e( 'Configure and Customize', 'equity' ); ?></a></li>
<li><a href="<?php echo admin_url(); ?>widgets.php"><?php _e( 'Setup widgets', 'equity' ); ?></a></li>
<li><a href="<?php echo admin_url(); ?>nav-menus.php"><?php _e( 'Create menus', 'equity' ); ?></a></li>
<li><?php printf( __( 'Create a new %1$s or %2$s', 'equity' ), '<a href="' . admin_url() . 'post-new.php">' . __( 'Post', 'equity' ) . '</a>', '<a href="' . admin_url() . 'post-new.php?post_type=page">' . __( 'Page', 'equity' ) . '</a>'); ?></li>
</ul>
</div>
<div class="columns small-12 large-4 add-idx">
<i class="fas fa-fw fa-home"></i>
<h5><?php _e('Add IDX', 'equity'); ?></h5>
<ul>
<li><a href="<?php echo apply_filters( 'equity_welcome_link_idx', $equity_idx_link = 'https://signup.idxbroker.com/' ); ?>"><?php _e('Sign up for IDX Broker', 'equity'); ?></a></li>
</ul>
</div>
<div class="columns small-12 large-4 get-support">
<i class="fas fa-fw fa-question"></i>
<h5><?php _e('Need Help?', 'equity'); ?></h5>
<ul>
<li><a href="<?php echo apply_filters( 'equity_welcome_link_guide', $equity_guide_link = 'http://www.agentevolution.com/knowledge-base/' ); ?>"><?php _e('Read the setup guide', 'equity'); ?></a></li>
</ul>
</div>
</div>
<?php
}
//* Initialize Equity
equity();
} else {
equity();
}