mirror of
https://github.com/10h30/trestle.git
synced 2026-07-11 18:56:07 +09:00
Compare commits
35 Commits
2.0.1
...
retina-logos
| Author | SHA1 | Date | |
|---|---|---|---|
| 81b17fd9b7 | |||
| 3e6432dc8d | |||
| 8cd6b7ae9b | |||
| 05448fdd0f | |||
| 2950acb3b6 | |||
| e437b1dd68 | |||
| 4341f49977 | |||
| 4a763ee628 | |||
| 2199c0709a | |||
| 786b246206 | |||
| 77deddd2b8 | |||
| e1090a9de7 | |||
| d8ea929b16 | |||
| f43864af2d | |||
| ddef43a7a5 | |||
| 6460223c7f | |||
| 02feca7265 | |||
| c8b594d747 | |||
| 48a83ba64a | |||
| f87fc1e50e | |||
| d369ef6853 | |||
| 2faea53445 | |||
| df35ff6560 | |||
| d8d22e6def | |||
| 7a5acbbe9a | |||
| 88a3261cfd | |||
| 7e5e7b03dc | |||
| e45223311a | |||
| ed20653fbb | |||
| 68aa66d549 | |||
| 119078fc26 | |||
| 03de45dadd | |||
| 851f5ff19d | |||
| 54eb9ab02c | |||
| 4b85568883 |
+4
-4
@@ -28,10 +28,10 @@ require_once dirname( __FILE__ ) . '/includes/shortcodes/shortcodes.php';
|
||||
require_once dirname( __FILE__ ) . '/includes/widget-areas/widget-areas.php';
|
||||
|
||||
// Plugin activation class.
|
||||
require_once dirname( __FILE__ ) . '/includes/classes/class-tgm-plugin-activation.php';
|
||||
require_once dirname( __FILE__ ) . '/lib/class-tgm-plugin-activation.php';
|
||||
|
||||
// Better Font Awesome Library.
|
||||
require_once dirname( __FILE__ ) . '/lib/better-font-awesome-library/better-font-awesome-library.php';
|
||||
// Dev utility functions.
|
||||
require_once dirname( __FILE__ ) . '/includes/utilities/utilities.php';
|
||||
|
||||
|
||||
add_action( 'genesis_setup', 'trestle_theme_setup', 15 );
|
||||
@@ -49,7 +49,7 @@ function trestle_theme_setup() {
|
||||
// Child theme definitions (do not remove).
|
||||
define( 'TRESTLE_THEME_NAME', 'Trestle' );
|
||||
define( 'TRESTLE_THEME_URL', 'http://demo.mightyminnow.com/theme/trestle/' );
|
||||
define( 'TRESTLE_THEME_VERSION', '2.0.1' );
|
||||
define( 'TRESTLE_THEME_VERSION', '2.1.0' );
|
||||
define( 'TRESTLE_SETTINGS_FIELD', 'trestle-settings' );
|
||||
|
||||
// Setup default theme settings.
|
||||
|
||||
Regular → Executable
+44
-51
@@ -19,10 +19,11 @@ function trestle_settings_defaults() {
|
||||
// Trestle default key/value pairs.
|
||||
$trestle_defaults = array(
|
||||
'layout' => 'solid',
|
||||
'logo_url' => '',
|
||||
'logo_url_mobile' => '',
|
||||
'logo_id' => '',
|
||||
'logo_id_mobile' => '',
|
||||
'favicon_url' => '',
|
||||
'nav_primary_location' => 'full',
|
||||
'mobile_nav_toggle' => 'small-icon',
|
||||
'search_in_nav' => '',
|
||||
'read_more_text' => __( 'Read More »', 'trestle' ),
|
||||
'revisions_number' => 3,
|
||||
@@ -94,6 +95,33 @@ function trestle_admin_actions() {
|
||||
|
||||
}
|
||||
|
||||
add_filter( 'tiny_mce_before_init', 'trestle_tiny_mce_before_init' );
|
||||
/**
|
||||
* Add custom classes to the body of TinyMCE previews.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
function trestle_tiny_mce_before_init( $init_array ) {
|
||||
|
||||
global $post;
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
// If we're on an edit screen, add an appropriate 'post-id-XX' or 'page-id-XX'.
|
||||
if ( 'edit' == $screen->parent_base ) {
|
||||
|
||||
// Custom post types always use 'post', so we only need to handle pages.
|
||||
$post_type = ( 'page' == $post->post_type ) ? 'page' : 'post';
|
||||
|
||||
$init_array['body_class'] .= sprintf( ' %s-id-%s',
|
||||
$post_type,
|
||||
$post->ID
|
||||
);
|
||||
}
|
||||
|
||||
return $init_array;
|
||||
}
|
||||
|
||||
add_action( 'tgmpa_register', 'trestle_register_required_plugins' );
|
||||
/**
|
||||
* Loads required & recommended plugins.
|
||||
@@ -128,30 +156,6 @@ function trestle_register_required_plugins() {
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Equal Height Columns',
|
||||
'slug' => 'equal-height-columns',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Events Manager',
|
||||
'slug' => 'events-manager',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Exclude Pages',
|
||||
'slug' => 'exclude-pages',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Facebook Open Graph Meta Tags for WordPress',
|
||||
'slug' => 'wonderm00ns-simple-facebook-open-graph-tags',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Easy FancyBox',
|
||||
'slug' => 'easy-fancybox',
|
||||
@@ -159,8 +163,14 @@ function trestle_register_required_plugins() {
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Genesis Featured Widget Amplified',
|
||||
'slug' => 'genesis-featured-widget-amplified',
|
||||
'name' => 'Equal Height Columns',
|
||||
'slug' => 'equal-height-columns',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Exclude Pages',
|
||||
'slug' => 'exclude-pages',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
@@ -176,30 +186,12 @@ function trestle_register_required_plugins() {
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Jetpack by WordPress.com',
|
||||
'slug' => 'jetpack',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'MapPress Easy Google Maps',
|
||||
'slug' => 'mappress-google-maps-for-wordpress',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'My Page Order',
|
||||
'slug' => 'my-page-order',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'NextGen Gallery',
|
||||
'slug' => 'nextgen-gallery',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Post Thumbnail Editor',
|
||||
'slug' => 'post-thumbnail-editor',
|
||||
@@ -219,8 +211,8 @@ function trestle_register_required_plugins() {
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Social Media Widget',
|
||||
'slug' => 'social-media-widget',
|
||||
'name' => 'RICG Responsive Images',
|
||||
'slug' => 'ricg-responsive-images',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
@@ -249,14 +241,15 @@ function trestle_register_required_plugins() {
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'WP Hotkeys',
|
||||
'slug' => 'wp-hotkeys',
|
||||
'name' => 'WordPress SEO by Yoast',
|
||||
'slug' => 'wordpress-seo',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
// Change this to your theme text domain, used for internationalising strings.
|
||||
$theme_text_domain = 'mightyminnow';
|
||||
$theme_text_domain = 'trestle';
|
||||
|
||||
/**
|
||||
* Array of configuration settings. Amend each line as needed.
|
||||
|
||||
Regular → Executable
+150
-124
@@ -25,8 +25,8 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_section(
|
||||
'trestle_settings_section',
|
||||
array(
|
||||
'title' => __( 'Trestle Settings', 'trestle' ),
|
||||
'priority' => 160,
|
||||
'title' => __( 'Trestle Settings', 'trestle' ),
|
||||
'priority' => 160,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -34,65 +34,67 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[layout]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'layout' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => trestle_get_option( 'layout' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_layout_control',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[layout]',
|
||||
'label' => __( 'Layout', 'trestle' ),
|
||||
'type' => 'radio',
|
||||
'choices' => array(
|
||||
'bubble' => __( 'Bubble', 'trestle' ),
|
||||
'solid' => __( 'Solid', 'trestle' ),
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[layout]',
|
||||
'label' => __( 'Layout', 'trestle' ),
|
||||
'type' => 'radio',
|
||||
'choices' => array(
|
||||
'bubble' => __( 'Bubble', 'trestle' ),
|
||||
'solid' => __( 'Solid', 'trestle' ),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Upload a logo.
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[logo_url]',
|
||||
'trestle-settings[logo_id]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'logo_url' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'default' => trestle_get_option( 'logo_id' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'absint',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Image_Control(
|
||||
new WP_Customize_Media_Control(
|
||||
$wp_customize,
|
||||
'trestle_logo_control',
|
||||
array(
|
||||
'label' => __( 'Upload a logo', 'trestle' ),
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[logo_url]',
|
||||
'label' => __( 'Upload a logo', 'trestle' ),
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[logo_id]',
|
||||
'mime_type' => 'image',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Upload a mobile logo.
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[logo_url_mobile]',
|
||||
'trestle-settings[logo_id_mobile]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'logo_url_mobile' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'default' => trestle_get_option( 'logo_id_mobile' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'absint',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Image_Control(
|
||||
new WP_Customize_Media_Control(
|
||||
$wp_customize,
|
||||
'trestle_mobile_logo_control',
|
||||
array(
|
||||
'label' => __( 'Upload a mobile logo', 'trestle' ),
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[logo_url_mobile]',
|
||||
'label' => __( 'Upload a mobile logo', 'trestle' ),
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[logo_id_mobile]',
|
||||
'mime_type' => 'image',
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -101,10 +103,10 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[favicon_url]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'favicon_url' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'default' => trestle_get_option( 'favicon_url' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
@@ -112,9 +114,9 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize,
|
||||
'trestle_favicon_control',
|
||||
array(
|
||||
'label' => __( 'Upload a favicon', 'trestle' ),
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[favicon_url]',
|
||||
'label' => __( 'Upload a favicon', 'trestle' ),
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[favicon_url]',
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -123,21 +125,44 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[nav_primary_location]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'nav_primary_location' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => trestle_get_option( 'nav_primary_location' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_nav_primary_location_control',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[nav_primary_location]',
|
||||
'label' => __( 'Menu style', 'trestle' ),
|
||||
'type' => 'select',
|
||||
'choices' => array(
|
||||
'full' => __( 'Full Width', 'trestle' ),
|
||||
'header' => __( 'Header Right', 'trestle' ),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Mobile nav toggle.
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[mobile_nav_toggle]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'mobile_nav_toggle' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_mobile_nav_toggle_control',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[nav_primary_location]',
|
||||
'label' => __( 'Menu style', 'trestle' ),
|
||||
'settings' => 'trestle-settings[mobile_nav_toggle]',
|
||||
'label' => __( 'Mobile Menu Toggle', 'trestle' ),
|
||||
'type' => 'select',
|
||||
'choices' => array(
|
||||
'full' => __( 'Full Width', 'trestle' ),
|
||||
'header' => __( 'Header Right', 'trestle' ),
|
||||
'small-icon' => __( 'Small Icon', 'trestle' ),
|
||||
'big-button' => __( 'Big Button', 'trestle' ),
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -146,9 +171,9 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[search_in_nav]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'search_in_nav' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => trestle_get_option( 'search_in_nav' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
@@ -157,7 +182,7 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[search_in_nav]',
|
||||
'label' => __( 'Add search to mobile navigation', 'trestle' ),
|
||||
'type' => 'checkbox',
|
||||
'type' => 'checkbox',
|
||||
)
|
||||
);
|
||||
|
||||
@@ -165,18 +190,18 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[read_more_text]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'read_more_text' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'wp_kses_post',
|
||||
'default' => trestle_get_option( 'read_more_text' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'wp_kses_post',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_read_more_text_control',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[read_more_text]',
|
||||
'label' => __( 'Custom read more link text', 'trestle' ),
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[read_more_text]',
|
||||
'label' => __( 'Custom read more link text', 'trestle' ),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -184,31 +209,32 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[revisions_number]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'revisions_number' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => trestle_get_option( 'revisions_number' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'absint',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_revisions_number_control',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[revisions_number]',
|
||||
'label' => __( 'Number of post revisions', 'trestle' ),
|
||||
'type' => 'select',
|
||||
'choices' => array(
|
||||
'-1' => __( 'Unlimited', 'trestle' ),
|
||||
'0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6',
|
||||
'7' => '7',
|
||||
'8' => '8',
|
||||
'9' => '9',
|
||||
'10' => '10',
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[revisions_number]',
|
||||
'label' => __( 'Number of post revisions', 'trestle' ),
|
||||
'type' => 'select',
|
||||
'choices' => array(
|
||||
'-1' => __( 'Unlimited', 'trestle' ),
|
||||
'0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6',
|
||||
'7' => '7',
|
||||
'8' => '8',
|
||||
'9' => '9',
|
||||
'10' => '10',
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -217,26 +243,26 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[footer_widgets_number]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'footer_widgets_number' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => trestle_get_option( 'footer_widgets_number' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_footer_widgets_number_control',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[footer_widgets_number]',
|
||||
'label' => __( 'Number of footer widgets', 'trestle' ),
|
||||
'type' => 'select',
|
||||
'choices' => array(
|
||||
'0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6',
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[footer_widgets_number]',
|
||||
'label' => __( 'Number of footer widgets', 'trestle' ),
|
||||
'type' => 'select',
|
||||
'choices' => array(
|
||||
'0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6',
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -245,17 +271,17 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[link_icons_title]',
|
||||
array(
|
||||
'default' => '',
|
||||
'type' => 'option',
|
||||
'default' => '',
|
||||
'type' => 'option',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_link_icons_title',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[link_icons_title]',
|
||||
'label' => __( 'Icon links', 'trestle' ),
|
||||
'type' => 'hidden',
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[link_icons_title]',
|
||||
'label' => __( 'Icon links', 'trestle' ),
|
||||
'type' => 'hidden',
|
||||
)
|
||||
);
|
||||
|
||||
@@ -263,18 +289,18 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[external_link_icons]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'external_link_icons' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => trestle_get_option( 'external_link_icons' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_external_link_icons',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[external_link_icons]',
|
||||
'label' => __( 'Add icons to external links', 'trestle' ),
|
||||
'type' => 'checkbox',
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[external_link_icons]',
|
||||
'label' => __( 'Add icons to external links', 'trestle' ),
|
||||
'type' => 'checkbox',
|
||||
)
|
||||
);
|
||||
|
||||
@@ -282,18 +308,18 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[email_link_icons]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'email_link_icons' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => trestle_get_option( 'email_link_icons' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_email_link_icons',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[email_link_icons]',
|
||||
'label' => __( 'Add icons to email links', 'trestle' ),
|
||||
'type' => 'checkbox',
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[email_link_icons]',
|
||||
'label' => __( 'Add icons to email links', 'trestle' ),
|
||||
'type' => 'checkbox',
|
||||
)
|
||||
);
|
||||
|
||||
@@ -301,18 +327,18 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[pdf_link_icons]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'pdf_link_icons' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => trestle_get_option( 'pdf_link_icons' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_pdf_link_icons',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[pdf_link_icons]',
|
||||
'label' => __( 'Add icons to .pdf links', 'trestle' ),
|
||||
'type' => 'checkbox',
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[pdf_link_icons]',
|
||||
'label' => __( 'Add icons to .pdf links', 'trestle' ),
|
||||
'type' => 'checkbox',
|
||||
)
|
||||
);
|
||||
|
||||
@@ -320,18 +346,18 @@ function trestle_customizer_controls( $wp_customize ) {
|
||||
$wp_customize->add_setting(
|
||||
'trestle-settings[doc_link_icons]',
|
||||
array(
|
||||
'default' => trestle_get_option( 'doc_link_icons' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => trestle_get_option( 'doc_link_icons' ),
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control(
|
||||
'trestle_doc_link_icons',
|
||||
array(
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[doc_link_icons]',
|
||||
'label' => __( 'Add icons to .doc links', 'trestle' ),
|
||||
'type' => 'checkbox',
|
||||
'section' => 'trestle_settings_section',
|
||||
'settings' => 'trestle-settings[doc_link_icons]',
|
||||
'label' => __( 'Add icons to .doc links', 'trestle' ),
|
||||
'type' => 'checkbox',
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Regular → Executable
+88
-25
@@ -31,6 +31,18 @@ function trestle_add_theme_support() {
|
||||
|
||||
}
|
||||
|
||||
add_action( 'after_setup_theme', 'trestle_remove_genesis_css_enqueue' );
|
||||
/**
|
||||
* Stop Genesis from enqueuing the child theme stylesheet in the usual way.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
function trestle_remove_genesis_css_enqueue() {
|
||||
|
||||
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
|
||||
|
||||
}
|
||||
|
||||
/*===========================================
|
||||
* 3rd Party Libraries
|
||||
===========================================*/
|
||||
@@ -43,6 +55,9 @@ add_action( 'init', 'trestle_load_bfa' );
|
||||
*/
|
||||
function trestle_load_bfa() {
|
||||
|
||||
// Better Font Awesome Library
|
||||
require_once trailingslashit( get_stylesheet_directory() ) . 'lib/better-font-awesome-library/better-font-awesome-library.php';
|
||||
|
||||
// Set the library initialization args.
|
||||
$args = array(
|
||||
'version' => 'latest',
|
||||
@@ -63,7 +78,7 @@ function trestle_load_bfa() {
|
||||
* Header
|
||||
===========================================*/
|
||||
|
||||
add_action( 'wp_enqueue_scripts', 'trestle_header_actions' );
|
||||
add_action( 'wp_enqueue_scripts', 'trestle_header_actions', 15 );
|
||||
/**
|
||||
* Loads theme scripts and styles.
|
||||
*
|
||||
@@ -71,12 +86,25 @@ add_action( 'wp_enqueue_scripts', 'trestle_header_actions' );
|
||||
*/
|
||||
function trestle_header_actions() {
|
||||
|
||||
// Our main stylesheet.
|
||||
wp_enqueue_style( 'trestle', get_stylesheet_uri(), array(), TRESTLE_THEME_VERSION );
|
||||
|
||||
// Google fonts.
|
||||
wp_enqueue_style( 'theme-google-fonts', '//fonts.googleapis.com/css?family=Lato:300,400,700' );
|
||||
|
||||
// Theme jQuery.
|
||||
wp_enqueue_script( 'theme-jquery', get_stylesheet_directory_uri() . '/includes/js/theme-jquery.js', array( 'jquery' ), TRESTLE_THEME_VERSION, true );
|
||||
|
||||
// Prepare and include some necessary variables.
|
||||
$mobile_nav_text = apply_filters( 'trestle_mobile_nav_text', __( 'Navigation', 'trestle' ) );
|
||||
wp_localize_script(
|
||||
'theme-jquery',
|
||||
'trestle_vars',
|
||||
array(
|
||||
'mobile_nav_text' => esc_attr( $mobile_nav_text ),
|
||||
)
|
||||
);
|
||||
|
||||
// Get WP uploads directory.
|
||||
$upload_dir = wp_upload_dir();
|
||||
$upload_path = $upload_dir['basedir'];
|
||||
@@ -132,22 +160,16 @@ function trestle_body_classes( $classes ) {
|
||||
if ( 'bubble' == trestle_get_option( 'layout' ) )
|
||||
$classes[] = 'bubble';
|
||||
|
||||
/**
|
||||
* Add link icon classes.
|
||||
*/
|
||||
|
||||
// Add link icon classes.
|
||||
if ( trestle_get_option( 'external_link_icons' ) ) {
|
||||
$classes[] = 'external-link-icons';
|
||||
}
|
||||
|
||||
if ( trestle_get_option( 'email_link_icons' ) ) {
|
||||
$classes[] = 'email-link-icons';
|
||||
}
|
||||
|
||||
if ( trestle_get_option( 'pdf_link_icons' ) ) {
|
||||
$classes[] = 'pdf-link-icons';
|
||||
}
|
||||
|
||||
if ( trestle_get_option( 'doc_link_icons' ) ) {
|
||||
$classes[] = 'doc-link-icons';
|
||||
}
|
||||
@@ -158,6 +180,14 @@ function trestle_body_classes( $classes ) {
|
||||
$classes[] = 'nav-primary-location-' . $nav_primary_location;
|
||||
}
|
||||
|
||||
// Add mobile menu toggle class.
|
||||
$mobile_nav_toggle = esc_attr( trestle_get_option( 'mobile_nav_toggle' ) );
|
||||
if ( 'big-button' == $mobile_nav_toggle ) {
|
||||
$classes[] = 'big-button-nav-toggle';
|
||||
} elseif ( 'small-icon' == $mobile_nav_toggle ) {
|
||||
$classes[] = 'small-icon-nav-toggle';
|
||||
}
|
||||
|
||||
// Add footer widget number class.
|
||||
$footer_widgets_number = esc_attr( trestle_get_option( 'footer_widgets_number' ) );
|
||||
if ( $footer_widgets_number ) {
|
||||
@@ -186,42 +216,55 @@ add_filter( 'genesis_seo_title', 'trestle_do_logos', 10, 3 );
|
||||
*/
|
||||
function trestle_do_logos( $title, $inside, $wrap ) {
|
||||
|
||||
$logo_url = trestle_get_option( 'logo_url' );
|
||||
$logo_url_mobile = trestle_get_option( 'logo_url_mobile' );
|
||||
$logo_id = trestle_get_option( 'logo_id' );
|
||||
$logo_id_mobile = trestle_get_option( 'logo_id_mobile' );
|
||||
$logo_html = '';
|
||||
|
||||
// Regular logo.
|
||||
if ( $logo_url ) {
|
||||
if ( $logo_id ) {
|
||||
|
||||
// Default logo class.
|
||||
$classes = array('logo-full');
|
||||
// Default logo classes.
|
||||
$classes = array(
|
||||
'logo',
|
||||
'logo-full'
|
||||
);
|
||||
|
||||
// If no mobile logo is specified, make regular logo act as mobile logo too.
|
||||
if( ! $logo_url_mobile )
|
||||
if( ! $logo_id_mobile ) {
|
||||
$classes[] = 'show';
|
||||
}
|
||||
|
||||
$logo_html .= sprintf( '<img class="logo %s" alt="%s" src="%s" />',
|
||||
implode(' ', $classes),
|
||||
esc_attr( get_bloginfo( 'name' ) ),
|
||||
$logo_url
|
||||
// Prepare the classes.
|
||||
$logo_attr = array(
|
||||
'class' => implode( $classes, ' ' ),
|
||||
);
|
||||
|
||||
// Build the <img> tag.
|
||||
$logo_html .= wp_get_attachment_image( $logo_id, 'full', false, $logo_attr );
|
||||
|
||||
}
|
||||
|
||||
// Mobile logo.
|
||||
if ( $logo_url_mobile ) {
|
||||
if ( $logo_id_mobile ) {
|
||||
|
||||
// Default mobile logo class.
|
||||
$classes = array('logo-mobile');
|
||||
$classes = array(
|
||||
'logo',
|
||||
'logo-mobile'
|
||||
);
|
||||
|
||||
// If no regular logo is specified, make mobile logo act as regular logo too.
|
||||
if( ! $logo_url )
|
||||
if( ! $logo_id )
|
||||
$classes[] = 'show';
|
||||
|
||||
$logo_html .= sprintf( '<img class="logo %s" alt="%s" src="%s" />',
|
||||
implode(' ', $classes),
|
||||
esc_attr( get_bloginfo( 'name' ) ),
|
||||
$logo_url_mobile
|
||||
// Prepare the classes.
|
||||
$logo_attr = array(
|
||||
'class' => implode( $classes, ' ' ),
|
||||
);
|
||||
|
||||
// Build the <img> tag.
|
||||
$logo_html .= wp_get_attachment_image( $logo_id_mobile, 'full', false, $logo_attr );
|
||||
|
||||
}
|
||||
|
||||
if ( $logo_html ) {
|
||||
@@ -288,6 +331,26 @@ function trestle_custom_nav_extras( $nav_items, stdClass $menu_args ) {
|
||||
* Posts & Pages
|
||||
===========================================*/
|
||||
|
||||
add_filter( 'post_class', 'trestle_post_classes' );
|
||||
/**
|
||||
* Add extra classes to posts in certain situations.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*
|
||||
* @param array $classes Post classes.
|
||||
* @return array Updated post classes.
|
||||
*/
|
||||
function trestle_post_classes( $classes ) {
|
||||
|
||||
// If post doesn't have a featured image.
|
||||
if ( ! has_post_thumbnail() ) {
|
||||
$classes[] = 'no-featured-image';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
|
||||
}
|
||||
|
||||
add_filter( 'wp_revisions_to_keep', 'trestle_update_revisions_number', 10, 2 );
|
||||
/**
|
||||
* Sets the number of post revisions.
|
||||
|
||||
Regular → Executable
+110
-95
@@ -6,137 +6,152 @@
|
||||
* @package Trestle
|
||||
*/
|
||||
|
||||
// Executes when the document is ready
|
||||
// Executes when the document is ready.
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
|
||||
// Remove .no-jquery body class
|
||||
$( 'body' ).removeClass( 'no-jquery' );
|
||||
// Store selectors we use multiple times.
|
||||
$body = $( 'body' );
|
||||
|
||||
// External Links
|
||||
var h = window.location.host.toLowerCase();
|
||||
$( '[href^="http"]' ).not( '[href*="' + h + '"]' ).addClass( 'external-link' ).attr( "target", "_blank" );
|
||||
// Remove .no-jquery body class.
|
||||
$body.removeClass( 'no-jquery' );
|
||||
|
||||
// Add classes to different types of links
|
||||
$( 'a[href^="mailto:"]' ).addClass( 'email-link' );
|
||||
$( 'a[href$=".pdf"]' ).attr({ "target":"_blank" }).addClass( 'pdf-link' );
|
||||
$( 'a[href$=".doc"]' ).attr({ "target":"_blank" }).addClass( 'doc-link' );
|
||||
$( 'a' ).has( 'img' ).addClass( 'image-link' );
|
||||
// External Links.
|
||||
var h = window.location.host.toLowerCase();
|
||||
$( '[href^="http"]' ).not( '[href*="' + h + '"]' ).addClass( 'external-link' ).attr( "target", "_blank" );
|
||||
|
||||
// Add classes to parts of lists
|
||||
$( 'li:last-child' ).addClass( 'last' );
|
||||
$( 'li:first-child' ).addClass( 'first' );
|
||||
$( 'ul, ol' ).parent( 'li' ).addClass( 'parent' );
|
||||
// Add classes to different types of links.
|
||||
$( 'a[href^="mailto:"]' ).addClass( 'email-link' );
|
||||
$( 'a[href$=".pdf"]' ).attr({ "target":"_blank" }).addClass( 'pdf-link' );
|
||||
$( 'a[href$=".doc"]' ).attr({ "target":"_blank" }).addClass( 'doc-link' );
|
||||
$( 'a' ).has( 'img' ).addClass( 'image-link' );
|
||||
|
||||
// Create mobile header toggle buttons
|
||||
$( '.site-header .title-area' ).after( '<div class="toggle-buttons" />' );
|
||||
$( '.site-header .widget-area, .nav-primary' ).each( function( i ) {
|
||||
// Add classes to parts of lists.
|
||||
$( 'li:last-child' ).addClass( 'last' );
|
||||
$( 'li:first-child' ).addClass( 'first' );
|
||||
$( 'ul, ol' ).parent( 'li' ).addClass( 'parent' );
|
||||
|
||||
// Store target
|
||||
$target = $( this );
|
||||
// Create container for toggle buttons.
|
||||
if ( $body.hasClass( 'big-button-nav-toggle' ) ) {
|
||||
$( '.site-header' ).after( '<div class="header-toggle-buttons" />' );
|
||||
} else {
|
||||
$( '.site-header .title-area' ).after( '<div class="header-toggle-buttons" />' );
|
||||
}
|
||||
|
||||
// Scope variables
|
||||
var $target, buttonClass, targetClass;
|
||||
// Add either small icon toggles or big button toggle.
|
||||
$( '.site-header .widget-area, .nav-primary' ).each( function( i ) {
|
||||
|
||||
// Setup classes
|
||||
buttonClass = 'toggle-button';
|
||||
targetClass = $target.attr( 'class' ).split( /\s+/ );
|
||||
// Store target.
|
||||
$target = $( this );
|
||||
|
||||
// Add targets-[] class to buttonClass
|
||||
$.each( targetClass, function( index, value ) {
|
||||
buttonClass += ' targets-' + value;
|
||||
});
|
||||
// Scope variables.
|
||||
var $target, buttonClass, targetClass;
|
||||
|
||||
// Add nav-toggle class to buttonClass if the button is for the nav
|
||||
if ( $target.is( 'nav' ) ) {
|
||||
buttonClass += ' nav-toggle';
|
||||
}
|
||||
// Setup classes.
|
||||
buttonClass = 'toggle-button';
|
||||
targetClass = $target.attr( 'class' ).split( /\s+/ );
|
||||
|
||||
// Add toggle buttons to header
|
||||
$( '.toggle-buttons' ).prepend( '<a id="toggle-button-' + i + '" class="' + buttonClass + '" href="#">Toggle</a>' );
|
||||
// Add targets-[] class to buttonClass.
|
||||
$.each( targetClass, function( index, value ) {
|
||||
buttonClass += ' targets-' + value;
|
||||
});
|
||||
|
||||
// Add target class to nav and widget areas
|
||||
$target.addClass( 'toggle-target-' + i );
|
||||
});
|
||||
// Add nav-toggle class to buttonClass if the button is for the nav.
|
||||
if ( $target.is( 'nav' ) ) {
|
||||
buttonClass += ' nav-toggle';
|
||||
}
|
||||
|
||||
// A widget areas and primary nav mobile toggle functionality
|
||||
$( '.site-header .toggle-button' ).click( function( event ) {
|
||||
// Allow the use of custom text when using the 'big-button' mobile nav style.
|
||||
if ( $target.is( 'nav' ) && $body.hasClass( 'big-button-nav-toggle' ) ) {
|
||||
navText = trestle_vars['mobile_nav_text'];
|
||||
} else {
|
||||
navText = 'Toggle';
|
||||
}
|
||||
|
||||
// Prevent default behavior
|
||||
event.preventDefault();
|
||||
// Add toggle buttons to header.
|
||||
$( '.header-toggle-buttons' ).prepend( '<a id="toggle-button-' + i + '" class="' + buttonClass + '" href="#">' + navText + '</a>' );
|
||||
|
||||
// Scope our variables
|
||||
var $button, $target;
|
||||
// Add target class to nav and widget areas.
|
||||
$target.addClass( 'toggle-target-' + i );
|
||||
});
|
||||
|
||||
// Get toggle button that was clicked
|
||||
$button = $( this );
|
||||
// A widget areas and primary nav mobile toggle functionality.
|
||||
$( '.header-toggle-buttons .toggle-button' ).click( function( event ) {
|
||||
|
||||
// Match the button to the right target
|
||||
$target = $( '.toggle-target-' + $button.attr( 'id' ).match( /\d+/ ) );
|
||||
console.log( 'Target: ' + $target.attr('class'));
|
||||
// Prevent default behavior.
|
||||
event.preventDefault();
|
||||
|
||||
// Toggle buttons
|
||||
$button.toggleClass( 'open' );
|
||||
$( '.site-header .toggle-button' ).not( $button ).removeClass( 'open' );
|
||||
// Scope our variables.
|
||||
var $button, $target;
|
||||
|
||||
// Toggle targets
|
||||
$target.toggleClass( 'open' );
|
||||
$( '[class*="toggle-target"]' ).not( $target ).removeClass( 'open' );
|
||||
// Get toggle button that was clicked.
|
||||
$button = $( this );
|
||||
|
||||
// Remove focus
|
||||
$button.blur();
|
||||
// Match the button to the right target.
|
||||
$target = $( '.toggle-target-' + $button.attr( 'id' ).match( /\d+/ ) );
|
||||
|
||||
});
|
||||
// Toggle buttons.
|
||||
$button.toggleClass( 'open' );
|
||||
$( '.header-toggle-buttons .toggle-button' ).not( $button ).removeClass( 'open' );
|
||||
|
||||
// Mobile navigation icons
|
||||
var closedIcon = '+';
|
||||
var openIcon = '-';
|
||||
// Toggle targets.
|
||||
$target.toggleClass( 'open' );
|
||||
$( '[class*="toggle-target"]' ).not( $target ).removeClass( 'open' );
|
||||
|
||||
// Insert the icons into the nav where appropriate
|
||||
$( '.nav-primary' ).find( '.genesis-nav-menu .parent:not( .current-menu-item, .current_page_item, .current_page_parent, .current_page_ancestor) > a' ).after( '<a class="sub-icon" href="#">' + closedIcon + '</a>' );
|
||||
$( '.nav-primary' ).find( '.genesis-nav-menu .parent.current-menu-item > a, .genesis-nav-menu .parent.current_page_item > a, .genesis-nav-menu .parent.current_page_parent > a, .genesis-nav-menu .parent.current_page_ancestor > a' ).after( '<a class="sub-icon" href="#">' + openIcon + '</a>' );
|
||||
// Remove focus.
|
||||
$button.blur();
|
||||
|
||||
// Mobile navigation expand/contract functionality
|
||||
$( '.sub-icon' ).click( function( event ) {
|
||||
});
|
||||
|
||||
// Prevent default behavior
|
||||
event.preventDefault();
|
||||
// Mobile navigation icons.
|
||||
var closedIcon = '+';
|
||||
var openIcon = '-';
|
||||
|
||||
// Get icon click
|
||||
var $icon = $( this );
|
||||
// Insert the icons into the nav where appropriate.
|
||||
$( '.nav-primary' ).find( '.genesis-nav-menu .parent:not( .current-menu-item, .current_page_item, .current_page_parent, .current_page_ancestor) > a' ).after( '<a class="sub-icon" href="#">' + closedIcon + '</a>' );
|
||||
$( '.nav-primary' ).find( '.genesis-nav-menu .parent.current-menu-item > a, .genesis-nav-menu .parent.current_page_item > a, .genesis-nav-menu .parent.current_page_parent > a, .genesis-nav-menu .parent.current_page_ancestor > a' ).after( '<a class="sub-icon" href="#">' + openIcon + '</a>' );
|
||||
|
||||
// Remove focus
|
||||
$icon.blur();
|
||||
// Mobile navigation expand/contract functionality.
|
||||
$( '.sub-icon' ).click( function( event ) {
|
||||
|
||||
// Expand/contract
|
||||
$icon.next( 'ul' ).slideToggle().toggleClass( 'open' );
|
||||
// Prevent default behavior.
|
||||
event.preventDefault();
|
||||
|
||||
// Change the icon to indicate open/closed
|
||||
if ( $icon.text().indexOf( closedIcon ) !== -1 ) {
|
||||
$icon.text( openIcon );
|
||||
} else if ( $icon.text().indexOf( openIcon ) !== -1 ) {
|
||||
$icon.text( closedIcon );
|
||||
}
|
||||
});
|
||||
// Get icon click.
|
||||
var $icon = $( this );
|
||||
|
||||
// Header widget area expand/contract functionality
|
||||
$( '.widget-area-toggle' ).click( function( event ) {
|
||||
// Remove focus.
|
||||
$icon.blur();
|
||||
|
||||
// Prevent default behavior
|
||||
event.preventDefault();
|
||||
// Expand/contract.
|
||||
$icon.next( 'ul' ).slideToggle().toggleClass( 'open' );
|
||||
|
||||
// Get button clicked
|
||||
var $button = $( this );
|
||||
// Change the icon to indicate open/closed.
|
||||
if ( $icon.text().indexOf( closedIcon ) !== -1 ) {
|
||||
$icon.text( openIcon );
|
||||
} else if ( $icon.text().indexOf( openIcon ) !== -1 ) {
|
||||
$icon.text( closedIcon );
|
||||
}
|
||||
});
|
||||
|
||||
// Remove focus
|
||||
$button.blur();
|
||||
// Header widget area expand/contract functionality.
|
||||
$( '.widget-area-toggle' ).click( function( event ) {
|
||||
|
||||
// Expand/contract
|
||||
$button.toggleClass( 'open' ).next( '.widget-area' ).slideToggle();
|
||||
});
|
||||
// Prevent default behavior.
|
||||
event.preventDefault();
|
||||
|
||||
// Executes when complete page is fully loaded, including all frames, objects, and images
|
||||
$( window ).on( 'load', function() {
|
||||
// Get button clicked.
|
||||
var $button = $( this );
|
||||
|
||||
});
|
||||
// Remove focus.
|
||||
$button.blur();
|
||||
|
||||
// Expand/contract.
|
||||
$button.toggleClass( 'open' ).next( '.widget-area' ).slideToggle();
|
||||
});
|
||||
|
||||
// Executes when complete page is fully loaded, including all frames, objects, and images.
|
||||
$( window ).on( 'load', function() {
|
||||
|
||||
});
|
||||
|
||||
}); /* end of page load scripts */
|
||||
@@ -50,10 +50,13 @@ add_shortcode( 'col', 'trestle_column' );
|
||||
* @return string Shortcode output.
|
||||
*/
|
||||
function trestle_column( $atts, $content = null ) {
|
||||
extract( shortcode_atts( array(
|
||||
|
||||
$atts = shortcode_atts( array(
|
||||
'class' => '',
|
||||
), $atts ) );
|
||||
return '<div class="col ' . $class . '">' . do_shortcode( $content ) . '</div>';
|
||||
), $atts );
|
||||
|
||||
return '<div class="col ' . $atts['class'] . '">' . do_shortcode( $content ) . '</div>';
|
||||
|
||||
}
|
||||
|
||||
add_shortcode( 'button', 'trestle_button' );
|
||||
@@ -67,13 +70,16 @@ add_shortcode( 'button', 'trestle_button' );
|
||||
* @return string Shortcode output.
|
||||
*/
|
||||
function trestle_button( $atts, $content = null ) {
|
||||
extract( shortcode_atts( array(
|
||||
|
||||
$atts = shortcode_atts( array(
|
||||
'href' => '#',
|
||||
'target' => '',
|
||||
'title' => '',
|
||||
'class' => '',
|
||||
), $atts ) );
|
||||
return '<a class="button ' . $class . '" href="' . $href . '" title="' . $title . '" target="' . $target . '">' . do_shortcode( $content ) . '</a>';
|
||||
), $atts );
|
||||
|
||||
return '<a class="button ' . $atts['class'] . '" href="' . $atts['href'] . '" title="' . $atts['title'] . '" target="' . $atts['target'] . '">' . do_shortcode( $content ) . '</a>';
|
||||
|
||||
}
|
||||
|
||||
add_shortcode( 'date', 'trestle_date' );
|
||||
@@ -87,15 +93,17 @@ add_shortcode( 'date', 'trestle_date' );
|
||||
* @return string Shortcode output.
|
||||
*/
|
||||
function trestle_date( $atts ) {
|
||||
extract( shortcode_atts( array(
|
||||
'format' => 'M d, Y',
|
||||
), $atts ) );
|
||||
|
||||
if ( ! $format ) {
|
||||
$format = 'M d, Y';
|
||||
$atts = shortcode_atts( array(
|
||||
'format' => 'M d, Y',
|
||||
), $atts );
|
||||
|
||||
if ( ! $atts['format'] ) {
|
||||
$atts['format'] = 'M d, Y';
|
||||
}
|
||||
|
||||
return date( $format );
|
||||
return date( $atts['format'] );
|
||||
|
||||
}
|
||||
|
||||
add_shortcode( 'blockquote', 'trestle_blockquote_shortcode' );
|
||||
@@ -111,6 +119,7 @@ add_shortcode( 'blockquote', 'trestle_blockquote_shortcode' );
|
||||
* @return string Shortcode output.
|
||||
*/
|
||||
function trestle_blockquote_shortcode( $atts, $content = null ) {
|
||||
|
||||
$atts = shortcode_atts( array(
|
||||
'citation' => '',
|
||||
), $atts );
|
||||
@@ -134,4 +143,5 @@ function trestle_blockquote_shortcode( $atts, $content = null ) {
|
||||
$output = ob_get_clean();
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Development utility functions.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @package Trestle
|
||||
*/
|
||||
|
||||
/**
|
||||
* Custom logging function for development purposes.
|
||||
*/
|
||||
function trestle_log( $log ) {
|
||||
if ( true === WP_DEBUG ) {
|
||||
if ( is_array( $log ) || is_object( $log ) ) {
|
||||
error_log( print_r( $log, true ) );
|
||||
} else {
|
||||
error_log( $log );
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+2209
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
Description: Trestle is a Genesis child theme for developers based on the default <a href="http://www.genesisframework.com/">Genesis 2.0 Sample Theme</a>. It features mobile first CSS, helpful theme options, and lots more tools to support your development process.
|
||||
Author: MIGHTYminnow
|
||||
Author URI: http://www.mightyminnow.com/
|
||||
Version: 2.0.1
|
||||
Version: 2.1.0
|
||||
Tags: black, gray, red, white, light, one-column, two-columns, three-columns, left-sidebar, right-sidebar, fluid-layout, responsive-layout, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, front-page-post-form, full-width-template, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, genesis, mobile-first, responsive, clean
|
||||
Text Domain: trestle
|
||||
GitHub Theme URI: MIGHTYminnow/trestle
|
||||
@@ -156,6 +156,8 @@ body.mce-content-body {
|
||||
width: auto;
|
||||
margin: 10px;
|
||||
float: none;
|
||||
-webkit-font-smoothing: auto !important;
|
||||
font-smoothing: auto !important;
|
||||
}
|
||||
|
||||
body.bubble {
|
||||
@@ -328,6 +330,11 @@ a:hover {
|
||||
margin: 0 4px;
|
||||
white-space: nowrap;
|
||||
font-family: FontAwesome;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.external-link-icons .external-link:after {
|
||||
@@ -602,40 +609,6 @@ body .red:hover {
|
||||
border-color: #555;
|
||||
}
|
||||
|
||||
body .blue {
|
||||
background-color: #0971b2;
|
||||
border-color: #0971b2;
|
||||
}
|
||||
|
||||
body .blue:hover {
|
||||
background-color: #333;
|
||||
border-color: #333;
|
||||
}
|
||||
|
||||
body .green {
|
||||
background-color: #00a476;
|
||||
border-color: #00a476;
|
||||
}
|
||||
|
||||
body .green:hover {
|
||||
background-color: #333;
|
||||
border-color: #333;
|
||||
}
|
||||
|
||||
.arrow-right:after {
|
||||
display: inline-block;
|
||||
content: "\00a0\00a0\f0a9";
|
||||
font-family: FontAwesome;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.arrow-left:before {
|
||||
display: inline-block;
|
||||
content: "\f0a8\00a0\00a0";
|
||||
font-family: FontAwesome;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* Tables
|
||||
--------------------------------------------- */
|
||||
|
||||
@@ -676,6 +649,10 @@ Structure and Layout
|
||||
/* Site Containers
|
||||
--------------------------------------------- */
|
||||
|
||||
.site-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.site-inner,
|
||||
.wrap {
|
||||
margin: 0 auto;
|
||||
@@ -1289,6 +1266,11 @@ th a.wpv-header-desc:after {
|
||||
margin-left: 0.5em;
|
||||
font-family: FontAwesome;
|
||||
font-size: 0.7em;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
th a.wpv-header-desc:after {
|
||||
@@ -1388,31 +1370,72 @@ Site Header
|
||||
/* Header Toggle Styles
|
||||
--------------------------------------------- */
|
||||
|
||||
.site-header .toggle-buttons {
|
||||
.header-toggle-buttons {
|
||||
font-size: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.site-header .toggle-button {
|
||||
.header-toggle-buttons .toggle-button {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.site-header .toggle-button.open {
|
||||
.header-toggle-buttons .toggle-button.open {
|
||||
color: #f15123;
|
||||
}
|
||||
|
||||
.site-header .toggle-button:before {
|
||||
.header-toggle-buttons .toggle-button:before {
|
||||
content: "\f002";
|
||||
font-family: FontAwesome;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-size: 28px;
|
||||
font-size: 2.8rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.site-header .toggle-button.nav-toggle:before {
|
||||
.header-toggle-buttons .toggle-button.nav-toggle:before {
|
||||
content: "\f0c9";
|
||||
}
|
||||
|
||||
.big-button-nav-toggle .header-toggle-buttons .nav-toggle {
|
||||
display: block;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
margin-left: 0;
|
||||
font-size: 16px;
|
||||
font-size: 1.6rem;
|
||||
padding: 15px 26px;
|
||||
padding: 1.5rem 2.6rem;
|
||||
margin: 0 20px;
|
||||
margin: 0 2rem;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
text-transform: uppercase;
|
||||
-webkit-transition: all 0s;
|
||||
-moz-transition: all 0s;
|
||||
-ms-transition: all 0s;
|
||||
-o-transition: all 0s;
|
||||
transition: all 0s;
|
||||
}
|
||||
|
||||
.big-button-nav-toggle .header-toggle-buttons .nav-toggle:before {
|
||||
content: "\f0ca";
|
||||
margin-right: 8px;
|
||||
font-size: 16px;
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
.big-button-nav-toggle .header-toggle-buttons .targets-widget-area {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
right: 2rem;
|
||||
top: 20px;
|
||||
top: 2rem;
|
||||
}
|
||||
|
||||
.nav-primary,
|
||||
.site-header .widget-area {
|
||||
position: absolute;
|
||||
@@ -1446,7 +1469,6 @@ Site Header
|
||||
transition: z-index 0s ease, opacity 0.25s 0s;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Site Navigation
|
||||
---------------------------------------------------------------------------------------------------- */
|
||||
@@ -1589,6 +1611,12 @@ Site Navigation
|
||||
padding-right: 5rem;
|
||||
}
|
||||
|
||||
.big-button-nav-toggle .nav-primary {
|
||||
margin: 4px 20px 0;
|
||||
margin: 0.4rem 2rem 0;
|
||||
border-radius: 3px;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Navigation Extras
|
||||
--------------------------------------------- */
|
||||
@@ -1618,8 +1646,10 @@ Site Navigation
|
||||
}
|
||||
|
||||
.genesis-nav-menu > .right .search-form {
|
||||
display: inline-block;
|
||||
padding: 8px 0;
|
||||
display: block;
|
||||
padding: 0;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.genesis-nav-menu > .right input[type="submit"] {
|
||||
@@ -1670,6 +1700,7 @@ Site Navigation
|
||||
|
||||
/* Header Primary Navigation
|
||||
--------------------------------------------- */
|
||||
|
||||
.site-header .nav-primary {
|
||||
margin: 0;
|
||||
}
|
||||
@@ -1682,8 +1713,6 @@ Site Navigation
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Non jQuery Styles
|
||||
--------------------------------------------- */
|
||||
|
||||
@@ -2227,6 +2256,7 @@ Media Queries
|
||||
|
||||
/* Header Toggle Styles
|
||||
--------------------------------------------- */
|
||||
|
||||
.nav-primary,
|
||||
.site-header .nav-primary,
|
||||
.site-header .widget-area {
|
||||
@@ -2245,11 +2275,11 @@ Media Queries
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.site-header .toggle-button {
|
||||
.header-toggle-buttons .toggle-button,
|
||||
.big-button-nav-toggle .header-toggle-buttons .toggle-button.nav-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* Content
|
||||
--------------------------------------------- */
|
||||
|
||||
@@ -2498,6 +2528,11 @@ Media Queries
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.genesis-nav-menu > .right .search-form {
|
||||
display: inline-block;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
/* Sub Menus
|
||||
--------------------------------------------- */
|
||||
|
||||
@@ -2524,6 +2559,11 @@ Media Queries
|
||||
margin-left: 8px;
|
||||
font-family: FontAwesome;
|
||||
font-size: .6em;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.genesis-nav-menu ul .parent > a:after {
|
||||
@@ -2533,6 +2573,11 @@ Media Queries
|
||||
margin: 0;
|
||||
font-family: FontAwesome;
|
||||
font-size: .8em;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -2552,8 +2597,17 @@ Media Queries
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
/* Primary Navigation
|
||||
--------------------------------------------- */
|
||||
|
||||
.big-button-nav-toggle .nav-primary {
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* Header Primary Navigation
|
||||
--------------------------------------------- */
|
||||
|
||||
.site-header .nav-primary {
|
||||
background-color: transparent;
|
||||
text-align: right;
|
||||
|
||||
Reference in New Issue
Block a user