Header Footer Elementor - Version 1.0.1

Version Description

  • New: Added support for the Astra WordPress theme - The Fastest, Most Lightweight & Customizable WordPress Theme.
  • Moved the menu under Appearance -> Header Footer Builder.
  • Fix: Header content getting hidden behind tha page content.
  • Use Elemenntor's canvas template when designing header and footer layout to have full width experience.
Download this release

Release Info

Developer Nikschavan
Plugin Icon Header Footer Elementor
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0.0 to 1.0.1

admin/{class-hfe-admin-ui.php → class-hfe-admin.php} RENAMED
@@ -43,8 +43,8 @@ class HFE_Admin {
43
  add_action( 'add_meta_boxes', array( $this, 'ehf_register_metabox' ) );
44
  add_action( 'save_post', array( $this, 'ehf_save_meta' ) );
45
  add_action( 'admin_notices', array( $this, 'location_notice' ) );
46
-
47
  add_action( 'template_redirect', array( $this, 'block_template_frontend' ) );
 
48
  }
49
 
50
  /**
@@ -53,32 +53,32 @@ class HFE_Admin {
53
  public function header_footer_posttype() {
54
 
55
  $labels = array(
56
- 'name' => __( 'Header / Footers Template', 'header-footer-elementor' ),
57
  'singular_name' => __( 'Elementor Header Footer', 'header-footer-elementor' ),
58
- 'menu_name' => __( 'Header / Footers Template', 'header-footer-elementor' ),
59
  'name_admin_bar' => __( 'Elementor Header Footer', 'header-footer-elementor' ),
60
  'add_new' => __( 'Add New', 'header-footer-elementor' ),
61
  'add_new_item' => __( 'Add New Header Footer', 'header-footer-elementor' ),
62
- 'new_item' => __( 'New Header / Footers Template', 'header-footer-elementor' ),
63
- 'edit_item' => __( 'Edit Header / Footers Template', 'header-footer-elementor' ),
64
- 'view_item' => __( 'View Header / Footers Template', 'header-footer-elementor' ),
65
  'all_items' => __( 'All Elementor Header Footers', 'header-footer-elementor' ),
66
- 'search_items' => __( 'Search Recipes', 'header-footer-elementor' ),
67
- 'parent_item_colon' => __( 'Parent Recipes:', 'header-footer-elementor' ),
68
- 'not_found' => __( 'No recipes found.', 'header-footer-elementor' ),
69
- 'not_found_in_trash' => __( 'No recipes found in Trash.', 'header-footer-elementor' ),
70
  );
71
 
72
  $args = array(
73
  'labels' => $labels,
74
- 'public' => true,
75
- 'rewrite' => false,
76
- 'show_ui' => true,
77
- 'show_in_menu' => false,
78
- 'show_in_nav_menus' => false,
79
  'exclude_from_search' => true,
80
- 'capability_type' => 'post',
81
- 'hierarchical' => false,
82
  'menu_icon' => 'dashicons-editor-kitchensink',
83
  'supports' => array( 'title', 'thumbnail', 'elementor' ),
84
  );
@@ -86,11 +86,18 @@ class HFE_Admin {
86
  register_post_type( 'elementor-hf', $args );
87
  }
88
 
 
 
 
 
 
 
 
89
  public function register_admin_menu() {
90
  add_submenu_page(
91
- 'options-general.php',
92
- __( 'Header Footer Templates', 'elementor', 'header-footer-elementor' ),
93
- __( 'Header Footer Templates', 'elementor', 'header-footer-elementor' ),
94
  'edit_pages',
95
  'edit.php?post_type=elementor-hf'
96
  );
@@ -132,6 +139,7 @@ class HFE_Admin {
132
  * Save meta field.
133
  *
134
  * @param POST $post_id Currennt post object which is being displayed.
 
135
  * @return Void
136
  */
137
  public function ehf_save_meta( $post_id ) {
@@ -155,15 +163,19 @@ class HFE_Admin {
155
  update_post_meta( $post_id, 'ehf_template_type', esc_attr( $_POST['ehf_template_type'] ) );
156
  }
157
 
158
-
159
  }
160
 
 
 
 
 
 
161
  public function location_notice() {
162
 
163
  global $pagenow;
164
  global $post;
165
 
166
- if ( 'post.php' != $pagenow || ! is_object( $post ) || 'header-footer-elementor' != $post->post_type ) {
167
  return;
168
  }
169
 
@@ -175,10 +187,10 @@ class HFE_Admin {
175
  // Check if more than one template is selected for current template type.
176
  if ( is_array( $templates ) && isset( $templates[1] ) && $post->ID != $templates[0] ) {
177
 
178
- $post_title = '<strong>' . get_the_title( $templates[0] ) . '</strong>';
179
- $template_location = '<strong>' . $this->template_location( $template_type ) . '</strong>';
180
-
181
- $message = __( sprintf( 'Template %s is already assigned to the location %s', $post_title, $template_location ), 'header-footer-elementor' );
182
 
183
  echo '<div class="error"><p>';
184
  echo $message;
@@ -188,11 +200,26 @@ class HFE_Admin {
188
 
189
  }
190
 
 
 
 
 
 
 
 
 
 
191
  public function template_location( $template_type ) {
192
  $template_type = ucfirst( str_replace( 'type_', '', $template_type ) );
 
193
  return $template_type;
194
  }
195
 
 
 
 
 
 
196
  public function block_template_frontend() {
197
  if ( is_singular( 'elementor-hf' ) && ! current_user_can( 'edit_posts' ) ) {
198
  wp_redirect( site_url(), 301 );
@@ -200,6 +227,24 @@ class HFE_Admin {
200
  }
201
  }
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  }
204
 
205
  HFE_Admin::instance();
43
  add_action( 'add_meta_boxes', array( $this, 'ehf_register_metabox' ) );
44
  add_action( 'save_post', array( $this, 'ehf_save_meta' ) );
45
  add_action( 'admin_notices', array( $this, 'location_notice' ) );
 
46
  add_action( 'template_redirect', array( $this, 'block_template_frontend' ) );
47
+ add_filter( 'single_template', array( $this, 'load_canvas_template' ) );
48
  }
49
 
50
  /**
53
  public function header_footer_posttype() {
54
 
55
  $labels = array(
56
+ 'name' => __( 'Header Footers Template', 'header-footer-elementor' ),
57
  'singular_name' => __( 'Elementor Header Footer', 'header-footer-elementor' ),
58
+ 'menu_name' => __( 'Header Footers Template', 'header-footer-elementor' ),
59
  'name_admin_bar' => __( 'Elementor Header Footer', 'header-footer-elementor' ),
60
  'add_new' => __( 'Add New', 'header-footer-elementor' ),
61
  'add_new_item' => __( 'Add New Header Footer', 'header-footer-elementor' ),
62
+ 'new_item' => __( 'New Header Footers Template', 'header-footer-elementor' ),
63
+ 'edit_item' => __( 'Edit Header Footers Template', 'header-footer-elementor' ),
64
+ 'view_item' => __( 'View Header Footers Template', 'header-footer-elementor' ),
65
  'all_items' => __( 'All Elementor Header Footers', 'header-footer-elementor' ),
66
+ 'search_items' => __( 'Search Header Footers Templates', 'header-footer-elementor' ),
67
+ 'parent_item_colon' => __( 'Parent Header Footers Templates:', 'header-footer-elementor' ),
68
+ 'not_found' => __( 'No Header Footers Templates found.', 'header-footer-elementor' ),
69
+ 'not_found_in_trash' => __( 'No Header Footers Templates found in Trash.', 'header-footer-elementor' ),
70
  );
71
 
72
  $args = array(
73
  'labels' => $labels,
74
+ 'public' => true,
75
+ 'rewrite' => false,
76
+ 'show_ui' => true,
77
+ 'show_in_menu' => false,
78
+ 'show_in_nav_menus' => false,
79
  'exclude_from_search' => true,
80
+ 'capability_type' => 'post',
81
+ 'hierarchical' => false,
82
  'menu_icon' => 'dashicons-editor-kitchensink',
83
  'supports' => array( 'title', 'thumbnail', 'elementor' ),
84
  );
86
  register_post_type( 'elementor-hf', $args );
87
  }
88
 
89
+ /**
90
+ * Register the admin menu for Header Footer builder.
91
+ *
92
+ * @since 1.0.0
93
+ * @since 1.0.1
94
+ * Moved the menu under Appearance -> Header Footer Builder
95
+ */
96
  public function register_admin_menu() {
97
  add_submenu_page(
98
+ 'themes.php',
99
+ __( 'Header Footer Builder', 'header-footer-elementor' ),
100
+ __( 'Header Footer Builder', 'header-footer-elementor' ),
101
  'edit_pages',
102
  'edit.php?post_type=elementor-hf'
103
  );
139
  * Save meta field.
140
  *
141
  * @param POST $post_id Currennt post object which is being displayed.
142
+ *
143
  * @return Void
144
  */
145
  public function ehf_save_meta( $post_id ) {
163
  update_post_meta( $post_id, 'ehf_template_type', esc_attr( $_POST['ehf_template_type'] ) );
164
  }
165
 
 
166
  }
167
 
168
+ /**
169
+ * Display notice when editing the header or footer when there is one more of similar layout is active on the site.
170
+ *
171
+ * @since 1.0.0
172
+ */
173
  public function location_notice() {
174
 
175
  global $pagenow;
176
  global $post;
177
 
178
+ if ( 'post.php' != $pagenow || ! is_object( $post ) || 'elementor-hf' != $post->post_type ) {
179
  return;
180
  }
181
 
187
  // Check if more than one template is selected for current template type.
188
  if ( is_array( $templates ) && isset( $templates[1] ) && $post->ID != $templates[0] ) {
189
 
190
+ $post_title = '<strong>' . get_the_title( $templates[0] ) . '</strong>';
191
+ $template_location = '<strong>' . $this->template_location( $template_type ) . '</strong>';
192
+ /* Translators: Post title, Template Location */
193
+ $message = sprintf( __( 'Template %1$s is already assigned to the location %2$s', 'header-footer-elementor' ), $post_title, $template_location );
194
 
195
  echo '<div class="error"><p>';
196
  echo $message;
200
 
201
  }
202
 
203
+ /**
204
+ * Convert the Template name to be added in the notice.
205
+ *
206
+ * @since 1.0.0
207
+ *
208
+ * @param String $template_type Template type name.
209
+ *
210
+ * @return String $template_type Template type name.
211
+ */
212
  public function template_location( $template_type ) {
213
  $template_type = ucfirst( str_replace( 'type_', '', $template_type ) );
214
+
215
  return $template_type;
216
  }
217
 
218
+ /**
219
+ * Don't display the elementor header footer templates on the frontend for non edit_posts capable users.
220
+ *
221
+ * @since 1.0.0
222
+ */
223
  public function block_template_frontend() {
224
  if ( is_singular( 'elementor-hf' ) && ! current_user_can( 'edit_posts' ) ) {
225
  wp_redirect( site_url(), 301 );
227
  }
228
  }
229
 
230
+ /**
231
+ * Single template function which will choose our template
232
+ *
233
+ * @since 1.0.1
234
+ *
235
+ * @param String $single_template Single template.
236
+ */
237
+ function load_canvas_template( $single_template ) {
238
+
239
+ global $post;
240
+
241
+ if ( 'elementor-hf' == $post->post_type ) {
242
+ return ELEMENTOR_PATH . '/includes/page-templates/canvas.php';
243
+ }
244
+
245
+ return $single_template;
246
+ }
247
+
248
  }
249
 
250
  HFE_Admin::instance();
assets/css/header-footer-elementor.css CHANGED
@@ -1,5 +1,5 @@
1
  .footer-width-fixer {
2
- width: 100%;
3
  }
4
 
5
  /* Container fix for genesis themes */
@@ -23,5 +23,11 @@
23
  }
24
 
25
  .bhf-hidden {
26
- display: none
27
  }
 
 
 
 
 
 
1
  .footer-width-fixer {
2
+ width: 100%;
3
  }
4
 
5
  /* Container fix for genesis themes */
23
  }
24
 
25
  .bhf-hidden {
26
+ display: none
27
  }
28
+
29
+ /* Fix: Header hidden below the page content */
30
+ .ehf-header header {
31
+ z-index: 30;
32
+ position: relative;
33
+ }
class-header-footer-elementor.php CHANGED
@@ -40,13 +40,16 @@ class Header_Footer_Elementor {
40
 
41
  if ( 'genesis' == $this->template ) {
42
 
43
- require HFE_DIR . 'themes/genesis/class-genesis-compat.php';
 
 
 
44
  } elseif ( 'bb-theme' == $this->template || 'beaver-builder-theme' == $this->template ) {
45
  $this->template = 'beaver-builder-theme';
46
- require HFE_DIR . 'themes/bb-theme/class-bb-theme-compat.php';
47
  } elseif ( 'generatepress' == $this->template ) {
48
 
49
- require HFE_DIR . 'themes/generatepress/generatepress-compat.php';
50
  } else {
51
 
52
  add_action( 'admin_notices', array( $this, 'unsupported_theme' ) );
@@ -69,13 +72,14 @@ class Header_Footer_Elementor {
69
  */
70
  public function elementor_not_available() {
71
 
72
- if ( file_exists( WP_PLUGIN_DIR . '/elementor/elementor.php' ) ) {
73
  $url = network_admin_url() . 'plugins.php?s=elementor';
74
  } else {
75
  $url = network_admin_url() . 'plugin-install.php?s=elementor';
76
  }
77
 
78
  echo '<div class="notice notice-error">';
 
79
  echo '<p>' . sprintf( __( 'The <strong>Header Footer Elementor</strong> plugin requires <strong><a href="%s">Elementor</strong></a> plugin installed & activated.', 'header-footer-elementor' ) . '</p>', $url );
80
  echo '</div>';
81
  }
@@ -84,7 +88,7 @@ class Header_Footer_Elementor {
84
  * Loads the globally required files for the plugin.
85
  */
86
  public function includes() {
87
- require_once HFE_DIR . 'admin/class-hfe-admin-ui.php';
88
  }
89
 
90
  /**
@@ -110,8 +114,8 @@ class Header_Footer_Elementor {
110
  */
111
  public function body_class( $classes ) {
112
 
113
- $header_id = Header_Footer_Elementor::get_settings( 'type_header', '' );
114
- $footer_id = Header_Footer_Elementor::get_settings( 'type_footer', '' );
115
 
116
  if ( '' !== $header_id ) {
117
  $classes[] = 'ehf-header';
@@ -182,7 +186,7 @@ class Header_Footer_Elementor {
182
  public static function get_template_id( $type ) {
183
 
184
  $cached = wp_cache_get( $type );
185
-
186
  if ( false !== $cached ) {
187
  return $cached;
188
  }
40
 
41
  if ( 'genesis' == $this->template ) {
42
 
43
+ require HFE_DIR . 'themes/genesis/class-hfe-genesis-compat.php';
44
+ } elseif ( 'astra' == $this->template ) {
45
+
46
+ require HFE_DIR . 'themes/astra/class-hfe-astra-compat.php';
47
  } elseif ( 'bb-theme' == $this->template || 'beaver-builder-theme' == $this->template ) {
48
  $this->template = 'beaver-builder-theme';
49
+ require HFE_DIR . 'themes/bb-theme/class-hfe-bb-theme-compat.php';
50
  } elseif ( 'generatepress' == $this->template ) {
51
 
52
+ require HFE_DIR . 'themes/generatepress/class-hfe-generatepress-compat.php';
53
  } else {
54
 
55
  add_action( 'admin_notices', array( $this, 'unsupported_theme' ) );
72
  */
73
  public function elementor_not_available() {
74
 
75
+ if ( file_exists( WP_PLUGIN_DIR . '/elementor/elementor.php' ) ) {
76
  $url = network_admin_url() . 'plugins.php?s=elementor';
77
  } else {
78
  $url = network_admin_url() . 'plugin-install.php?s=elementor';
79
  }
80
 
81
  echo '<div class="notice notice-error">';
82
+ /* Translators: URL to install or activate Elementor plugin. */
83
  echo '<p>' . sprintf( __( 'The <strong>Header Footer Elementor</strong> plugin requires <strong><a href="%s">Elementor</strong></a> plugin installed & activated.', 'header-footer-elementor' ) . '</p>', $url );
84
  echo '</div>';
85
  }
88
  * Loads the globally required files for the plugin.
89
  */
90
  public function includes() {
91
+ require_once HFE_DIR . 'admin/class-hfe-admin.php';
92
  }
93
 
94
  /**
114
  */
115
  public function body_class( $classes ) {
116
 
117
+ $header_id = Header_Footer_Elementor::get_settings( 'type_header', '' );
118
+ $footer_id = Header_Footer_Elementor::get_settings( 'type_footer', '' );
119
 
120
  if ( '' !== $header_id ) {
121
  $classes[] = 'ehf-header';
186
  public static function get_template_id( $type ) {
187
 
188
  $cached = wp_cache_get( $type );
189
+
190
  if ( false !== $cached ) {
191
  return $cached;
192
  }
header-footer-elementor.php CHANGED
@@ -7,7 +7,7 @@
7
  * Author URI: https://www.brainstormforce.com/
8
  * Text Domain: header-footer-elementor
9
  * Domain Path: /languages
10
- * Version: 1.0.0
11
  *
12
  * @package header-footer-elementor
13
  */
@@ -17,7 +17,7 @@
17
  */
18
  require_once 'class-header-footer-elementor.php';
19
 
20
- define( 'HFE_VER', '1.0.0' );
21
  define( 'HFE_DIR', plugin_dir_path( __FILE__ ) );
22
  define( 'HFE_URL', plugins_url( '/', __FILE__ ) );
23
  define( 'HFE_PATH', plugin_basename( __FILE__ ) );
7
  * Author URI: https://www.brainstormforce.com/
8
  * Text Domain: header-footer-elementor
9
  * Domain Path: /languages
10
+ * Version: 1.0.1
11
  *
12
  * @package header-footer-elementor
13
  */
17
  */
18
  require_once 'class-header-footer-elementor.php';
19
 
20
+ define( 'HFE_VER', '1.0.1' );
21
  define( 'HFE_DIR', plugin_dir_path( __FILE__ ) );
22
  define( 'HFE_URL', plugins_url( '/', __FILE__ ) );
23
  define( 'HFE_PATH', plugin_basename( __FILE__ ) );
languages/header-footer-elementor.pot CHANGED
@@ -5,7 +5,7 @@ msgstr ""
5
  "Project-Id-Version: Header Footer Elementor 1.0.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/header-footer-elementor\n"
8
- "POT-Creation-Date: 2017-03-07 08:24:30+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -25,69 +25,75 @@ msgstr ""
25
  "X-Poedit-Bookmarks: \n"
26
  "X-Textdomain-Support: yes\n"
27
 
28
- #: admin/class-hfe-admin-ui.php:56 admin/class-hfe-admin-ui.php:58
29
- msgid "Header / Footers Template"
30
  msgstr ""
31
 
32
- #: admin/class-hfe-admin-ui.php:57 admin/class-hfe-admin-ui.php:59
33
  msgid "Elementor Header Footer"
34
  msgstr ""
35
 
36
- #: admin/class-hfe-admin-ui.php:60
37
  msgid "Add New"
38
  msgstr ""
39
 
40
- #: admin/class-hfe-admin-ui.php:61
41
  msgid "Add New Header Footer"
42
  msgstr ""
43
 
44
- #: admin/class-hfe-admin-ui.php:62
45
- msgid "New Header / Footers Template"
46
  msgstr ""
47
 
48
- #: admin/class-hfe-admin-ui.php:63
49
- msgid "Edit Header / Footers Template"
50
  msgstr ""
51
 
52
- #: admin/class-hfe-admin-ui.php:64
53
- msgid "View Header / Footers Template"
54
  msgstr ""
55
 
56
- #: admin/class-hfe-admin-ui.php:65
57
  msgid "All Elementor Header Footers"
58
  msgstr ""
59
 
60
- #: admin/class-hfe-admin-ui.php:66
61
- msgid "Search Recipes"
62
  msgstr ""
63
 
64
- #: admin/class-hfe-admin-ui.php:67
65
- msgid "Parent Recipes:"
66
  msgstr ""
67
 
68
- #: admin/class-hfe-admin-ui.php:68
69
- msgid "No recipes found."
70
  msgstr ""
71
 
72
- #: admin/class-hfe-admin-ui.php:69
73
- msgid "No recipes found in Trash."
74
  msgstr ""
75
 
76
- #: admin/class-hfe-admin-ui.php:92 admin/class-hfe-admin-ui.php:93
77
- msgid "Header Footer Templates"
78
  msgstr ""
79
 
80
- #: admin/class-hfe-admin-ui.php:103
81
  msgid "Elementor Header Footer options"
82
  msgstr ""
83
 
84
- #: class-header-footer-elementor.php:79
 
 
 
 
 
 
85
  msgid ""
86
  "The <strong>Header Footer Elementor</strong> plugin requires <strong><a "
87
  "href=\"%s\">Elementor</strong></a> plugin installed & activated."
88
  msgstr ""
89
 
90
- #: class-header-footer-elementor.php:135
91
  msgid ""
92
  "Hey, your current theme is not supported by Header Footer Elementor, click "
93
  "<a "
5
  "Project-Id-Version: Header Footer Elementor 1.0.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/header-footer-elementor\n"
8
+ "POT-Creation-Date: 2017-06-08 05:20:36+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
25
  "X-Poedit-Bookmarks: \n"
26
  "X-Textdomain-Support: yes\n"
27
 
28
+ #: admin/class-hfe-admin.php:56 admin/class-hfe-admin.php:58
29
+ msgid "Header Footers Template"
30
  msgstr ""
31
 
32
+ #: admin/class-hfe-admin.php:57 admin/class-hfe-admin.php:59
33
  msgid "Elementor Header Footer"
34
  msgstr ""
35
 
36
+ #: admin/class-hfe-admin.php:60
37
  msgid "Add New"
38
  msgstr ""
39
 
40
+ #: admin/class-hfe-admin.php:61
41
  msgid "Add New Header Footer"
42
  msgstr ""
43
 
44
+ #: admin/class-hfe-admin.php:62
45
+ msgid "New Header Footers Template"
46
  msgstr ""
47
 
48
+ #: admin/class-hfe-admin.php:63
49
+ msgid "Edit Header Footers Template"
50
  msgstr ""
51
 
52
+ #: admin/class-hfe-admin.php:64
53
+ msgid "View Header Footers Template"
54
  msgstr ""
55
 
56
+ #: admin/class-hfe-admin.php:65
57
  msgid "All Elementor Header Footers"
58
  msgstr ""
59
 
60
+ #: admin/class-hfe-admin.php:66
61
+ msgid "Search Header Footers Templates"
62
  msgstr ""
63
 
64
+ #: admin/class-hfe-admin.php:67
65
+ msgid "Parent Header Footers Templates:"
66
  msgstr ""
67
 
68
+ #: admin/class-hfe-admin.php:68
69
+ msgid "No Header Footers Templates found."
70
  msgstr ""
71
 
72
+ #: admin/class-hfe-admin.php:69
73
+ msgid "No Header Footers Templates found in Trash."
74
  msgstr ""
75
 
76
+ #: admin/class-hfe-admin.php:99 admin/class-hfe-admin.php:100
77
+ msgid "Header Footer Builder"
78
  msgstr ""
79
 
80
+ #: admin/class-hfe-admin.php:110
81
  msgid "Elementor Header Footer options"
82
  msgstr ""
83
 
84
+ #: admin/class-hfe-admin.php:193
85
+ #. Translators: Post title, Template Location
86
+ msgid "Template %1$s is already assigned to the location %2$s"
87
+ msgstr ""
88
+
89
+ #: class-header-footer-elementor.php:83
90
+ #. Translators: URL to install or activate Elementor plugin.
91
  msgid ""
92
  "The <strong>Header Footer Elementor</strong> plugin requires <strong><a "
93
  "href=\"%s\">Elementor</strong></a> plugin installed & activated."
94
  msgstr ""
95
 
96
+ #: class-header-footer-elementor.php:139
97
  msgid ""
98
  "Hey, your current theme is not supported by Header Footer Elementor, click "
99
  "<a "
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: brainstormforce, Nikschavan
3
  Tags: elementor, header footer builder, header, footer, page builder, template builder, landing page builder, front-end editor
4
  Donate link: https://www.paypal.me/BrainstormForce
5
  Requires at least: 3.6
6
- Tested up to: 4.7.3
7
- Stable tag: 1.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,30 +14,62 @@ Create Header and Footer for your site using Elementor Page Builder.
14
 
15
  Create header and footer of your site easily using [Elementor](https://wordpress.org/plugins/elementor/ "Elementor").
16
 
 
 
 
 
 
 
 
 
 
 
 
17
  The plugin only works with limited number of themes as of now, here is the list of supported themes -
18
 
19
- 1. GeneratePress Theme
20
- 2. Genesis Theme
21
- 3. Beaver Builder theme
 
22
 
23
  = Supported & Actively Developed =
24
- Need help with something? Have an issue to report? [Get in touch](https://github.com/Nikschavan/header-footer-elementor "Header Footer elementor on GitHub"). with us on GitHub.
 
 
25
 
26
  == Installation ==
27
 
28
- 1. Upload the plugin files to the `/wp-content/plugins/header-footer-elementor` directory, or install the plugin through the WordPress plugins screen directly.
29
- 1. Activate the plugin through the 'Plugins' screen in WordPress
30
- 1. Use the Settings->Page Builder-> Header Footer Elemenntor to select the page to be displayed as header and footer.
 
31
 
32
  == Frequently Asked Questions ==
33
 
34
  = Which themes are supported by this plugin? =
35
 
36
- 1. Beaver Builder Theme.
37
- 2. Genesis Theme (and should work with most of its child themes).
38
- 3. GeneratePress Theme.
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  == Changelog ==
41
 
42
- = 1.0 =
43
- * Initial Release.
 
 
 
 
 
 
3
  Tags: elementor, header footer builder, header, footer, page builder, template builder, landing page builder, front-end editor
4
  Donate link: https://www.paypal.me/BrainstormForce
5
  Requires at least: 3.6
6
+ Tested up to: 4.8.0
7
+ Stable tag: 1.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
14
 
15
  Create header and footer of your site easily using [Elementor](https://wordpress.org/plugins/elementor/ "Elementor").
16
 
17
+ All you need to do is -
18
+
19
+ 1. Design a Header or Footer Template.
20
+ 2. Select the template type to be used for header or footer.
21
+ 3. The template will be used throughout the site as header / footer.
22
+
23
+ = Features of Beaver Builder Header Footer =
24
+
25
+ - Create attractive pages and templates that can be displayed as a Header or Footer.
26
+ - Lets you use a fully customized header or footer across the website.
27
+
28
  The plugin only works with limited number of themes as of now, here is the list of supported themes -
29
 
30
+ 1. <a href="https://wpastra.com/?utm_source=wp-repo&utm_campaign=header-footer-elementor&utm_medium=description">Astra</a> - The Fastest, Most Lightweight &amp; Customizable WordPress Theme.
31
+ 2. GeneratePress Theme.
32
+ 3. Genesis Theme.
33
+ 4. Beaver Builder theme.
34
 
35
  = Supported & Actively Developed =
36
+ Need help with something? Have an issue to report? [Get in touch](https://github.com/Nikschavan/header-footer-elemento "Header Footer elementor on GitHub"). with us on GitHub.
37
+
38
+ Made with love at <a href="https://www.brainstormforce.com/?utm_source=wp-repo&utm_campaign=header-footer-elementor&utm_medium=description">Brainstorm Force</a>!
39
 
40
  == Installation ==
41
 
42
+ 1. Go to `Plugins -> Add New` and search for Header Footer Elementor.
43
+ 1. Activate the plugin through the 'Plugins' screen in WordPress.
44
+ 1. Go to `Appearance -> Header Footer Builder` to build a header or footer layout using elementor.
45
+ 1. After the layout is ready assign the layout as header or footer using the option `Select the type of template this is` (<a href="https://cloudup.com/clK2sPg9nXK+">screenshot</a>)
46
 
47
  == Frequently Asked Questions ==
48
 
49
  = Which themes are supported by this plugin? =
50
 
51
+ 1. <a href="https://wpastra.com/?utm_source=wp-repo&utm_campaign=header-footer-elementor&utm_medium=description">Astra</a> - The Fastest, Most Lightweight &amp; Customizable WordPress Theme.
52
+ 2. Beaver Builder Theme.
53
+ 3. Genesis Theme (and should work with most of its child themes).
54
+ 4. GeneratePress Theme.
55
+
56
+ = How does this plugin work> =
57
+
58
+ 1. Go to `Appearance -> Header Footer Builder` to build a header or footer layout using elementor.
59
+ 1. After the layout is ready assign the layout as header or footer using the option `Select the type of template this is` (<a href="https://cloudup.com/clK2sPg9nXK+">screenshot</a>)
60
+
61
+ == Screenshots ==
62
+
63
+ 1. Go to Appearane -> Header Footer Builder to create a new template.
64
+ 2. After the template is reade, Assign the template to be header or footer replacement.
65
 
66
  == Changelog ==
67
 
68
+ = 1.0.1 =
69
+ - New: Added support for the <a href="https://wpastra.com/?utm_source=wp-repo&utm_campaign=bb-header-footer&utm_medium=description">Astra</a> WordPress theme - The Fastest, Most Lightweight &amp; Customizable WordPress Theme.
70
+ * Moved the menu under Appearance -> Header Footer Builder.
71
+ * Fix: Header content getting hidden behind tha page content.
72
+ * Use Elemenntor's canvas template when designing header and footer layout to have full width experience.
73
+
74
+ = 1.0.0 =
75
+ * Initial Release.
themes/astra/class-hfe-astra-compat.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * HFE_Astra_Compat setup
4
+ *
5
+ * @package header-footer-elementor
6
+ */
7
+
8
+ /**
9
+ * Astra theme compatibility.
10
+ */
11
+ class HFE_Astra_Compat {
12
+
13
+ /**
14
+ * Instance of HFE_Astra_Compat.
15
+ *
16
+ * @var HFE_Astra_Compat
17
+ */
18
+ private static $instance;
19
+
20
+ /**
21
+ * Initiator
22
+ */
23
+ public static function instance() {
24
+
25
+ if ( ! isset( self::$instance ) ) {
26
+ self::$instance = new HFE_Astra_Compat();
27
+
28
+ self::$instance->hooks();
29
+ }
30
+
31
+ return self::$instance;
32
+ }
33
+
34
+ /**
35
+ * Run all the Actions / Filters.
36
+ */
37
+ public function hooks() {
38
+
39
+ $header_id = Header_Footer_Elementor::get_settings( 'type_header', '' );
40
+ $footer_id = Header_Footer_Elementor::get_settings( 'type_footer', '' );
41
+
42
+ if ( '' !== $header_id ) {
43
+ add_action( 'template_redirect', array( $this, 'astra_setup_header' ), 10 );
44
+ add_action( 'astra_header', array( $this, 'add_header_markup' ) );
45
+ }
46
+
47
+ if ( '' !== $footer_id ) {
48
+ add_action( 'template_redirect', array( $this, 'astra_setup_footer' ), 10 );
49
+ add_action( 'astra_footer', array( $this, 'add_footer_markup' ) );
50
+ }
51
+
52
+ }
53
+
54
+ /**
55
+ * Disable header from the theme.
56
+ */
57
+ public function astra_setup_header() {
58
+ remove_action( 'astra_header', 'astra_header_markup' );
59
+ }
60
+
61
+ /**
62
+ * Display header markup.
63
+ */
64
+ public function add_header_markup() {
65
+ ?>
66
+ <header id="masthead" itemscope="itemscope" itemtype="http://schema.org/WPHeader">
67
+ <p class="main-title bhf-hidden" itemprop="headline"><a href="<?php echo bloginfo( 'url' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
68
+ <?php Header_Footer_Elementor::get_header_content(); ?>
69
+ </header>
70
+
71
+ <?php
72
+ }
73
+
74
+ /**
75
+ * Disable footer from the theme.
76
+ */
77
+ public function astra_setup_footer() {
78
+ remove_action( 'astra_footer', 'astra_footer_markup' );
79
+ }
80
+
81
+ /**
82
+ * Display footer markup.
83
+ */
84
+ public function add_footer_markup() {
85
+
86
+ ?>
87
+ <footer itemscope="itemscope" itemtype="http://schema.org/WPFooter">
88
+ <?php Header_Footer_Elementor::get_footer_content(); ?>
89
+ </footer>
90
+ <?php
91
+ }
92
+
93
+
94
+ }
95
+
96
+ HFE_Astra_Compat::instance();
themes/bb-theme/{class-bb-theme-compat.php → class-hfe-bb-theme-compat.php} RENAMED
@@ -58,17 +58,19 @@ class HFE_BB_Theme_Compat {
58
  */
59
  public function get_header_content() {
60
 
61
- $header_layout = FLTheme::get_setting( 'fl-header-layout' );
62
 
63
  if ( 'none' == $header_layout || is_page_template( 'tpl-no-header-footer.php' ) ) {
64
  return;
65
  }
66
 
67
  ?>
68
- <header id="masthead" itemscope="itemscope" itemtype="http://schema.org/WPHeader">
69
- <p class="main-title bhf-hidden" itemprop="headline"><a href="<?php echo bloginfo( 'url' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
70
- <?php Header_Footer_Elementor::get_header_content(); ?>
71
- </header>
 
 
72
  <?php
73
  }
74
 
@@ -82,9 +84,9 @@ class HFE_BB_Theme_Compat {
82
  }
83
 
84
  ?>
85
- <footer itemscope="itemscope" itemtype="http://schema.org/WPFooter">
86
- <?php Header_Footer_Elementor::get_footer_content(); ?>
87
- </footer>
88
  <?php
89
  }
90
 
58
  */
59
  public function get_header_content() {
60
 
61
+ $header_layout = FLTheme::get_setting( 'fl-header-layout' );
62
 
63
  if ( 'none' == $header_layout || is_page_template( 'tpl-no-header-footer.php' ) ) {
64
  return;
65
  }
66
 
67
  ?>
68
+ <header id="masthead" itemscope="itemscope" itemtype="http://schema.org/WPHeader">
69
+ <p class="main-title bhf-hidden" itemprop="headline"><a href="<?php echo bloginfo( 'url' ); ?>"
70
+ title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
71
+ rel="home"><?php bloginfo( 'name' ); ?></a></p>
72
+ <?php Header_Footer_Elementor::get_header_content(); ?>
73
+ </header>
74
  <?php
75
  }
76
 
84
  }
85
 
86
  ?>
87
+ <footer itemscope="itemscope" itemtype="http://schema.org/WPFooter">
88
+ <?php Header_Footer_Elementor::get_footer_content(); ?>
89
+ </footer>
90
  <?php
91
  }
92
 
themes/generatepress/{generatepress-compat.php → class-hfe-generatepress-compat.php} RENAMED
@@ -65,7 +65,7 @@ class HFE_GeneratePress_Compat {
65
  */
66
  public function generatepress_setup_footer() {
67
  remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
68
- remove_action( 'generate_footer','generate_construct_footer' );
69
  }
70
 
71
  /**
@@ -74,10 +74,12 @@ class HFE_GeneratePress_Compat {
74
  public function get_header_content() {
75
 
76
  ?>
77
- <header id="masthead" itemscope="itemscope" itemtype="http://schema.org/WPHeader">
78
- <p class="main-title bhf-hidden" itemprop="headline"><a href="<?php echo bloginfo( 'url' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
79
- <?php Header_Footer_Elementor::get_header_content(); ?>
80
- </header>
 
 
81
  <?php
82
  }
83
 
65
  */
66
  public function generatepress_setup_footer() {
67
  remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
68
+ remove_action( 'generate_footer', 'generate_construct_footer' );
69
  }
70
 
71
  /**
74
  public function get_header_content() {
75
 
76
  ?>
77
+ <header id="masthead" itemscope="itemscope" itemtype="http://schema.org/WPHeader">
78
+ <p class="main-title bhf-hidden" itemprop="headline"><a href="<?php echo bloginfo( 'url' ); ?>"
79
+ title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
80
+ rel="home"><?php bloginfo( 'name' ); ?></a></p>
81
+ <?php Header_Footer_Elementor::get_header_content(); ?>
82
+ </header>
83
  <?php
84
  }
85
 
themes/genesis/{class-genesis-compat.php → class-hfe-genesis-compat.php} RENAMED
@@ -60,7 +60,7 @@ class HFE_Genesis_Compat {
60
  */
61
  public function genesis_setup_header() {
62
 
63
- for ( $priority = 0; $priority < 16; $priority++ ) {
64
  remove_all_actions( 'genesis_header', $priority );
65
  }
66
 
@@ -71,7 +71,7 @@ class HFE_Genesis_Compat {
71
  */
72
  public function genesis_setup_footer() {
73
 
74
- for ( $priority = 0; $priority < 16; $priority++ ) {
75
  remove_all_actions( 'genesis_footer', $priority );
76
  }
77
 
@@ -126,8 +126,8 @@ class HFE_Genesis_Compat {
126
 
127
  genesis_structural_wrap( 'footer', 'close' );
128
  genesis_markup( array(
129
- 'html5' => '</footer>',
130
- 'xhtml' => '</div>',
131
  ) );
132
 
133
  }
60
  */
61
  public function genesis_setup_header() {
62
 
63
+ for ( $priority = 0; $priority < 16; $priority ++ ) {
64
  remove_all_actions( 'genesis_header', $priority );
65
  }
66
 
71
  */
72
  public function genesis_setup_footer() {
73
 
74
+ for ( $priority = 0; $priority < 16; $priority ++ ) {
75
  remove_all_actions( 'genesis_footer', $priority );
76
  }
77
 
126
 
127
  genesis_structural_wrap( 'footer', 'close' );
128
  genesis_markup( array(
129
+ 'html5' => '</footer>',
130
+ 'xhtml' => '</div>',
131
  ) );
132
 
133
  }