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 | |
| /** | |
| * Initialize Custom Metabox class. | |
| * https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress | |
| * https://github.com/mustardBees/cmb_field_map | |
| */ | |
| function sendtheme_initialize_metaboxes() { | |
| if ( !class_exists( 'cmb_Meta_Box' ) ) { | |
| require_once get_template_directory() . '/metaboxes-1.2.0/init.php'; |
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
| $latest_posts = new WP_Query( array( | |
| 'posts_per_page'=>3, | |
| 'ignore_sticky_posts' => true | |
| ) | |
| ); | |
| if ( $latest_posts->have_posts()) : ?> | |
| <ul class="latest-posts clear"> | |
| <?php while($latest_posts->have_posts()) : $latest_posts->the_post(); ?> | |
| <li id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
| <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> |
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
| if ( ! function_exists( 'mytheme_entry_image' ) ) : | |
| /** | |
| * Display an optional entry thumbnail. | |
| */ | |
| function mytheme_entry_image() { | |
| if ( ! has_post_thumbnail() ) { | |
| return; | |
| } | |
| $featured_image = get_post_thumbnail_id(); | |
| $attachment_page = esc_url( get_attachment_link( $featured_image ) ); |
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']; |
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
| <?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
| <?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 | |
| // 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 | |
| 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
| // 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) { | |