This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $wp_customize->add_section( 'header_background', array( | |
| 'title' => __( 'Custom Header Image', 'onehundred' ), | |
| 'priority' => 40, | |
| ) ); | |
| $wp_customize->add_setting( 'header_background', array( | |
| 'sanitize_callback' => 'construction_sanitize_file_url', | |
| ) ); | |
| $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'header_background', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function onehundred_testimonials_register_post_type() { | |
| $args = array( | |
| 'labels' => array( | |
| 'name' => _x( 'Testimonials', 'post type general name', 'onehundred' ), | |
| 'singular_name' => _x( 'Testimonial', 'post type singular name', 'onehundred' ), | |
| 'add_new' => _x( 'Add New', 'location', 'onehundred' ), | |
| 'add_new_item' => __( 'Add Testimonial', 'onehundred' ), | |
| 'edit_item' => __( 'Edit Testimonial', 'onehundred' ), | |
| 'new_item' => __( 'New Testimonial', 'onehundred' ), | |
| 'all_items' => __( 'All Testimonials', 'onehundred' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Enable Administrators to add a Custom CSS Control to the Customiser. | |
| */ | |
| function onehundred_enable_custom_css() { | |
| if ( current_user_can('create_users') ) { | |
| function onehundred_enable_custom_css_option() { | |
| register_setting('general', 'onehundred_enable_custom_css', 'wp_filter_nohtml_kses'); | |
| add_settings_field('onehundred_enable_custom_css', __('Enable Custom CSS?', 'onehundred') , 'onehundred_enable_custom_css_form', 'general'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // I am using Gravity Forms together with the 'User Registration' and 'PayPal Standard' Add-On's | |
| // to create new sites on a Multisite network. | |
| // Upon confirmation of a successful PayPal payment, a new site is created with some default pages | |
| // created and custom options applied. | |
| // An abbreviated version of my new site creation function is shown below: | |
| function new_site_setup($blog_id) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| global $current_user; | |
| get_currentuserinfo(); | |
| $salon_user = array( | |
| 'id' => 'salon-user', | |
| 'title' => __('Hi there, ','salon') . $current_user->display_name, | |
| 'href' => site_url() . '/wp-admin/profile.php', | |
| 'meta' => array('class' => 'salon-user', 'title' => __('Profile','salon')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // http://wordpress.org/support/topic/previous_image_link | |
| function mytheme_get_previous_image() { | |
| $image = mytheme_adjacent_image_link( true ); | |
| if ( $image ) : ?> | |
| <div class="nav-previous odd summary"> | |
| <div class="entry-meta entry-meta-above"><?php _e('Previous Image','sendtheme'); ?></div> | |
| <div class="entry-image"><?php echo $image; ?></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Add custom classes to the array of post classes. | |
| */ | |
| function sendtheme_post_classes( $classes ) { | |
| if ( wp_attachment_is_image() ) { | |
| $classes[] = 'attachment-image'; | |
| } | |
| return $classes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function mytheme_wrap_oembed_with_div( $html ) { | |
| return '<div class="oembed-container">' . $html . '</div>'; | |
| } | |
| add_filter( 'embed_oembed_html', 'mytheme_wrap_oembed_with_div', 10, 3); | |
| add_filter( 'video_embed_html', 'mytheme_wrap_oembed_with_div' ); | |
| ?> | |
| .oembed-container { | |
| display: block; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add an option to auto-advance the Featured Content Slider. | |
| */ | |
| $wp_customize->add_setting( 'featured_content_autoplay', array( | |
| 'default' => 'off', | |
| 'sanitize_callback' => 'mytheme_sanitize_autoplay', | |
| ) ); | |
| $wp_customize->add_control( 'featured_content_autoplay', array( | |
| 'label' => __( 'Autoplay', 'sendtheme' ), | |
| 'section' => 'featured_content', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Print the featured tag name, but only if the user has chosen not | |
| * to hide this tag (as per Theme Customizer setting). | |
| */ | |
| $featured_tag_options = get_option('featured-content'); | |
| $tag_name = $featured_tag_options['tag-name']; | |
| $hide_tag = $featured_tag_options['hide-tag']; |