Version Description
- Added option to make site title an h1 when editing homepage. More information: http://www.billerickson.net/genesis-h1-front-page/
Download this release
Release Info
Developer | billerickson |
Plugin | Genesis Title Toggle |
Version | 1.7.0 |
Comparing to | |
See all releases |
Code changes from version 1.6.2 to 1.7.0
- genesis-title-toggle.php +47 -1
- readme.txt +5 -2
genesis-title-toggle.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Turn on/off page titles on a per page basis, and set sitewide defaults from Theme Settings. Must be using the Genesis theme.
|
6 |
* Author: Bill Erickson
|
7 |
* Author URI: http://www.billerickson.net
|
8 |
-
* Version: 1.
|
9 |
* Text Domain: genesis-title-toggle
|
10 |
* Domain Path: languages
|
11 |
*
|
@@ -79,6 +79,9 @@ class BE_Title_Toggle {
|
|
79 |
} else {
|
80 |
add_action( 'genesis_before', array( $this, 'title_toggle' ) );
|
81 |
}
|
|
|
|
|
|
|
82 |
}
|
83 |
|
84 |
/**
|
@@ -223,6 +226,20 @@ class BE_Title_Toggle {
|
|
223 |
}
|
224 |
|
225 |
echo '</p>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
}
|
227 |
|
228 |
/**
|
@@ -262,6 +279,15 @@ class BE_Title_Toggle {
|
|
262 |
} else {
|
263 |
delete_post_meta( $post_id, $key );
|
264 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
}
|
266 |
|
267 |
/**
|
@@ -306,6 +332,26 @@ class BE_Title_Toggle {
|
|
306 |
}
|
307 |
}
|
308 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
}
|
310 |
|
311 |
new BE_Title_Toggle;
|
5 |
* Description: Turn on/off page titles on a per page basis, and set sitewide defaults from Theme Settings. Must be using the Genesis theme.
|
6 |
* Author: Bill Erickson
|
7 |
* Author URI: http://www.billerickson.net
|
8 |
+
* Version: 1.7.0
|
9 |
* Text Domain: genesis-title-toggle
|
10 |
* Domain Path: languages
|
11 |
*
|
79 |
} else {
|
80 |
add_action( 'genesis_before', array( $this, 'title_toggle' ) );
|
81 |
}
|
82 |
+
|
83 |
+
// Site title as h1
|
84 |
+
add_filter( 'genesis_site_title_wrap', array( $this, 'site_title_h1' ) );
|
85 |
}
|
86 |
|
87 |
/**
|
226 |
}
|
227 |
|
228 |
echo '</p>';
|
229 |
+
|
230 |
+
// Site title as h1
|
231 |
+
if( get_the_ID() == get_option( 'page_on_front' ) ) {
|
232 |
+
|
233 |
+
$h1_site_title = get_post_meta( get_the_ID(), 'be_title_toggle_site_title_h1', true );
|
234 |
+
$h1_site_title = !empty( $h1_site_title ) ? true : false;
|
235 |
+
|
236 |
+
echo '<p style="padding-top:10px;">';
|
237 |
+
printf( '<label for="be_title_toggle_site_title_h1">%s</label>', __( 'h1 Site Title', 'genesis-title-toggle' ) );
|
238 |
+
echo '<input type="checkbox" id="be_title_toggle_site_title_h1" name="be_title_toggle_site_title_h1" ' . checked( true , $h1_site_title, false ) . ' style="margin:0 20px 0 10px;">';
|
239 |
+
printf( '<span style="color:#999;">%s</span>', __( 'Make the site title in header an h1. This is HIGHLY recommended if you are removing the page title.', 'genesis-title-toggle' ) );
|
240 |
+
echo '</p>';
|
241 |
+
|
242 |
+
}
|
243 |
}
|
244 |
|
245 |
/**
|
279 |
} else {
|
280 |
delete_post_meta( $post_id, $key );
|
281 |
}
|
282 |
+
|
283 |
+
// Site title option for front page
|
284 |
+
if( $post_id == get_option( 'page_on_front' ) ) {
|
285 |
+
if( isset( $_POST['be_title_toggle_site_title_h1'] ) ) {
|
286 |
+
update_post_meta( $post_id, 'be_title_toggle_site_title_h1', '1' );
|
287 |
+
} else {
|
288 |
+
delete_post_meta( $post_id, 'be_title_toggle_site_title_h1' );
|
289 |
+
}
|
290 |
+
}
|
291 |
}
|
292 |
|
293 |
/**
|
332 |
}
|
333 |
}
|
334 |
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* Make Site Title an h1 on homepage
|
338 |
+
*
|
339 |
+
* @since 1.7.0
|
340 |
+
* @link http://www.billerickson.net/genesis-h1-front-page/
|
341 |
+
* @param string $wrap, html element wrapping the site title
|
342 |
+
* @return string $wrap
|
343 |
+
*/
|
344 |
+
function site_title_h1( $wrap ) {
|
345 |
+
|
346 |
+
if( is_front_page() && ! is_home() ) {
|
347 |
+
$show_as_h1 = get_post_meta( get_the_ID(), 'be_title_toggle_site_title_h1', true );
|
348 |
+
if( $show_as_h1 )
|
349 |
+
$wrap = 'h1';
|
350 |
+
}
|
351 |
+
|
352 |
+
return $wrap;
|
353 |
+
|
354 |
+
}
|
355 |
}
|
356 |
|
357 |
new BE_Title_Toggle;
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: billerickson
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EDYM76U6BTE5L
|
4 |
Tags: genesis, genesiswp, title,
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 4.3
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
Turn on/off page titles on a per page basis, and set sitewide defaults from Theme Settings. Must be using the Genesis theme.
|
10 |
|
@@ -40,6 +40,9 @@ Finally, if you're comfortable with code you can use the `be_title_toggle_post_t
|
|
40 |
|
41 |
== Changelog ==
|
42 |
|
|
|
|
|
|
|
43 |
= 1.6.2 =
|
44 |
* Fix issue when you have all titles disabled by default
|
45 |
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EDYM76U6BTE5L
|
4 |
Tags: genesis, genesiswp, title,
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 4.3.1
|
7 |
+
Stable tag: 1.7.0
|
8 |
|
9 |
Turn on/off page titles on a per page basis, and set sitewide defaults from Theme Settings. Must be using the Genesis theme.
|
10 |
|
40 |
|
41 |
== Changelog ==
|
42 |
|
43 |
+
= 1.7.0 =
|
44 |
+
* Added option to make site title an h1 when editing homepage. More information: http://www.billerickson.net/genesis-h1-front-page/
|
45 |
+
|
46 |
= 1.6.2 =
|
47 |
* Fix issue when you have all titles disabled by default
|
48 |
|