mirror of
https://github.com/10h30/trestle.git
synced 2026-07-11 18:56:07 +09:00
modified responsive nav css/jquery to support device w/out JS, added favicon
This commit is contained in:
Binary file not shown.
+13
-1
@@ -99,6 +99,12 @@ function trestle_register_required_plugins() {
|
||||
'required' => true,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Genesis Favicon Uploader',
|
||||
'slug' => 'genesis-favicon-uploader',
|
||||
'required' => true,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Genesis Featured Widget Amplified',
|
||||
'slug' => 'genesis-featured-widget-amplified',
|
||||
@@ -287,7 +293,7 @@ add_action( 'init', 'trestle_nav_modifications' );
|
||||
// Add mobile menu button
|
||||
function trestle_add_mobile_nav() {
|
||||
if ( 1 == genesis_get_option( 'auto_nav' ) || has_nav_menu( 'primary' ) )
|
||||
echo '<a id="menu-button" class="button" href="javascript: void()"><i class="icon-list-ul"></i> Navigation</a>';
|
||||
echo '<a id="menu-button" class="button" href="javascript: void(0)"><i class="icon-list-ul"></i> Navigation</a>';
|
||||
}
|
||||
add_action( 'genesis_after_header', 'trestle_add_mobile_nav', 0 );
|
||||
|
||||
@@ -296,6 +302,12 @@ add_action( 'genesis_after_header', 'trestle_add_mobile_nav', 0 );
|
||||
* Actions & Filters
|
||||
===========================================*/
|
||||
|
||||
// Add jquery class to body
|
||||
function no_jquery( $classes ) {
|
||||
$classes[] = 'no-jquery';
|
||||
return $classes;
|
||||
}
|
||||
add_filter('body_class','no_jquery');
|
||||
|
||||
/*===========================================
|
||||
* Footer
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
@@ -17,7 +17,7 @@ function trestle_custom_defaults( $defaults ) {
|
||||
|
||||
$defaults['auto_nav'] = '0';
|
||||
$defaults['include_home_link'] = '1';
|
||||
$defaults['footer_text'] = sprintf( '[footer_copyright before="%s "] · [footer_childtheme_link before="" after=" %s"] [footer_genesis_link url="http://www.studiopress.com/" before=""] · [footer_wordpress_link] · [footer_loginout]', __( 'Copyright', 'genesis' ), __( 'on', 'genesis' ) );
|
||||
$defaults['footer_text'] = sprintf( '[footer_copyright before="%s "] · [footer_childtheme_link before="" after=" %s"] [footer_genesis_link url="http://www.studiopress.com/" before=""] · [footer_wordpress_link] · [footer_loginout]', __( 'Copyright', 'trestle' ), __( 'on', 'trestle' ) );
|
||||
|
||||
return $defaults;
|
||||
}
|
||||
@@ -56,8 +56,15 @@ add_action( 'genesis_settings_sanitizer_init', 'trestle_register_social_sanitiza
|
||||
*/
|
||||
|
||||
function trestle_register_settings_box( $_genesis_theme_settings_pagehook ) {
|
||||
add_meta_box('mm-navigation-settings', 'Primary Navigation', 'trestle_navigation_settings_box', $_genesis_theme_settings_pagehook, 'main', 'high');
|
||||
// add_meta_box('mm-footer-settings', 'Footer', 'trestle_footer_settings_box', $_genesis_theme_settings_pagehook, 'main', 'high');
|
||||
|
||||
global $_genesis_admin_settings;
|
||||
|
||||
// Remove default Genesis nav metabox
|
||||
remove_meta_box('genesis-theme-settings-nav', $_genesis_admin_settings->pagehook, 'main');
|
||||
|
||||
// Call our own custom nav metabox which combines our own settings with Genesis'
|
||||
add_meta_box('mm-navigation-settings', __( 'Navigation', 'trestle' ), 'trestle_navigation_settings_box', $_genesis_theme_settings_pagehook, 'main', 'high');
|
||||
|
||||
}
|
||||
add_action('genesis_theme_settings_metaboxes', 'trestle_register_settings_box');
|
||||
|
||||
@@ -67,11 +74,15 @@ add_action('genesis_theme_settings_metaboxes', 'trestle_register_settings_box');
|
||||
|
||||
function trestle_navigation_settings_box() {
|
||||
?>
|
||||
<h4><?php _e( 'Primary Navigation Options', 'trestle' ) ?></h4>
|
||||
<p>
|
||||
<input type="checkbox" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[auto_nav]" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[auto_nav]" value="1" <?php checked( esc_attr( genesis_get_option('auto_nav') ), 1); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[auto_nav]">Automatically generate nav menu (replaces custom/manual menu with auto-generated menu)</label><br />
|
||||
<input type="checkbox" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[include_home_link]" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[include_home_link]" value="1" <?php checked( esc_attr( genesis_get_option('include_home_link') ), 1); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[include_home_link]">Include Home Link</label>
|
||||
<input type="checkbox" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[auto_nav]" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[auto_nav]" value="1" <?php checked( esc_attr( genesis_get_option('auto_nav') ), 1); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[auto_nav]"><?php _e(' Automatically generate nav menu (replaces custom/manual menu with auto-generated menu)', 'trestle' ); ?></label><br />
|
||||
<input type="checkbox" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[include_home_link]" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[include_home_link]" value="1" <?php checked( esc_attr( genesis_get_option('include_home_link') ), 1); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[include_home_link]"><?php _e( 'Include Home Link', 'trestle' ); ?></label>
|
||||
</p>
|
||||
<?php
|
||||
|
||||
$genesis_settings_object = new Genesis_Admin_Settings;
|
||||
$genesis_settings_object->nav_box();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// Executes when the document is ready
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
// Remove .no-jquery body class
|
||||
jQuery('body').removeClass('no-jquery');
|
||||
|
||||
// Get our URL
|
||||
var h = window.location.host.toLowerCase();
|
||||
|
||||
|
||||
@@ -1131,6 +1131,17 @@ Site Navigation
|
||||
color: #222;
|
||||
}
|
||||
|
||||
/* No jQuery styles */
|
||||
.no-jquery #menu-button {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.no-jquery #menu-button:hover + .nav-primary .genesis-nav-menu,
|
||||
.no-jquery .nav-primary a:hover + ul,
|
||||
.no-jquery ul:hover {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Secondary Navigation
|
||||
--------------------------------------------- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user