'; comments_popup_link( _x( '
Comments: None
', 'Behold' ) , _x( '
Comments: 1 comment
', 'comments number', 'Behold' ), _x( '
Comments: % comments
', 'comments number', 'Behold' ) ); echo '

'; endif; } endif; if ( ! function_exists( 'behold_get_post_categories' ) ) : function behold_get_post_categories() { $behold_categories_list = get_the_category_list(', ', ''); if ( $behold_categories_list ): printf( __( '

Categories: %1$s

', 'Behold' ), $behold_categories_list ); else: return false; endif; } endif; if ( ! function_exists( 'behold_get_post_tags' ) ) : function behold_get_post_tags() { $behold_tags_list = get_the_tag_list('', ', ', ''); if ( $behold_tags_list ): printf( __( '

Tags: %2$s

', 'Behold' ), 'Behold', $behold_tags_list ); else: return false; endif; } endif; if ( ! function_exists( 'behold_posted_at_with_author' ) ) : function behold_posted_at_with_author() { printf( __( '
Posted on
By
%7$s
', 'Behold' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'M j, Y' ) ), esc_html( get_the_date('M j, Y') ), esc_html( get_author_posts_url(get_the_author_meta( 'ID' )) ), esc_attr( sprintf( __( 'View all posts by %s', 'Behold' ), get_the_author() ) ), esc_html( get_the_author() ) ); } endif; if ( ! function_exists( 'behold_get_edit_link' ) ) : function behold_get_edit_link() { edit_post_link( __( 'Edit', 'Behold' ), '', '' ); } endif; if ( ! function_exists( 'behold_comment' ) ) : function behold_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
  • ', '' ); ?>

  • id="li-comment-">
    comment_parent ) $avatar_size = 39; echo get_avatar( $comment, $avatar_size ); ?>
    said:', 'Behold' ), sprintf( '%s', get_comment_author_link() ), sprintf( '%3$s', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'Behold' ), get_comment_date(), get_comment_time() ) ) ); edit_comment_link( __( 'Edit', 'Behold' ), '', '' ); ?>
    comment_approved == '0' ) : ?>
    __( 'Reply ', 'Behold' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    max_num_pages > 1 ) : ?>
    __( 'Toggleable right sidebar', 'Behold' ), 'id' => 'sidebar-1', 'description' => __( 'Optional: Appears on the right. Widgets will be toggleable. i.e visitors can expand/collapse the widget item.', 'Behold' ), 'before_widget' => '
    ', 'after_widget' => "
    ", 'before_title' => '

    ', 'after_title' => '

    ', )); register_sidebar( array( 'name' => __( 'Main Sidebar', 'Behold' ), 'id' => 'sidebar-2', 'description' => __( 'Optional: Appears on the right side of the page. Just a normal right sidebar.', 'Behold' ), 'before_widget' => '
    ', 'after_widget' => "
    ", 'before_title' => '

    ', 'after_title' => '

    ', )); register_sidebar( array( 'name' => __( 'Footer Sidebar', 'Behold' ), 'description' => __( 'Optional: Appears on the footer area of the web page', 'Behold' ), 'id' => 'sidebar-3', 'before_widget' => '
    ', 'after_widget' => "
    ", 'before_title' => '

    ', 'after_title' => '

    ', )); register_sidebar( array( 'name' => __( 'Footer Text Widget Area', 'Behold' ), 'description' => __( 'Optional: Use only the text-widget - appears inside the footer area, this is the first widget displayed even though the other footer widget area is used.', 'Behold' ), 'id' => 'sidebar-4', 'before_widget' => '
    ', 'after_widget' => "
    ", 'before_title' => '

    ', 'after_title' => '

    ', )); } add_action( 'widgets_init', 'behold_widgets_init' ); // Add support for custom headers. register_default_headers( array( 'hexagons' => array( 'url' => '%s/images/hello.png', 'thumbnail_url' => '%s/images/hello.png', /* translators: header image description */ 'description' => __( 'Smiley!', 'Behold' ) )) ); $custom_header_support = array( // The default header text color. 'default-text-color' => '000', // The height and width of our custom header. 'width' => '970', 'height' => '320', // Random image rotation by default. 'random-default' => true ); global $wp_version; if ( version_compare( $wp_version, '3.4', '>=' ) ) : add_theme_support( 'custom-header' ); add_theme_support( 'custom-header', $custom_header_support ); endif; function behold_new_excerpt_more($more) { global $post; return ' ' . __( 'Continue reading ', 'twentyeleven' ) . ''; } add_filter('excerpt_more', 'behold_new_excerpt_more'); function behold_get_featured_image() { global $post; if ( has_post_thumbnail( $post->ID ) ) { echo get_the_post_thumbnail( $post->ID, 'medium' ); } } if ( ! function_exists( 'behold_audio_grabber' ) ) { /** * Credit to - Pinktouch WP Theme! I could have written my own, thought why reinvent the wheel.. :) * Return the first audio file found for a post. * * @param int post_id ID for parent post * @return boolean|string Path to audio file */ function behold_audio_grabber( $post_id ) { global $wpdb; $first_audio = $wpdb->get_var( $wpdb->prepare( "SELECT guid FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'attachment' AND INSTR(post_mime_type, 'audio') ORDER BY menu_order ASC LIMIT 0,1", (int) $post_id ) ); # debug # printf("SELECT guid FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'attachment' AND INSTR(post_mime_type, 'audio') ORDER BY menu_order ASC LIMIT 0,1", (int) $post_id ); if ( ! empty( $first_audio ) ) return $first_audio; return false; } } function behold_theme_menu() { add_theme_page( 'behold_ Theme Options', // The title to be displayed in the browser window for this page. 'Social Media Options', // The text to be displayed for this menu item 'edit_theme_options', // Which type of users can see this menu item 'behold_theme_options', // The unique ID - that is, the slug - for this menu item 'behold_theme_display' // The name of the function to call when rendering this menu's page ); } add_action('admin_menu', 'behold_theme_menu'); function behold_theme_intialize_social_options() { if( false == get_option( 'behold_theme_social_options' ) ) { add_option( 'behold_theme_social_options' ); } add_settings_section( 'social_settings_section', // ID used to identify this section and with which to register options 'Social Media Buttons', // Title to be displayed on the administration page 'behold_social_options_callback', // Callback used to render the description of the section 'behold_theme_social_options' // Page on which to add this section of options ); add_settings_field( 'facebook', 'Facebook', 'behold_facebook_callback', 'behold_theme_social_options', 'social_settings_section' ); add_settings_field( 'twitter', 'Twitter', 'behold_twitter_callback', 'behold_theme_social_options', 'social_settings_section' ); add_settings_field( 'googleplus', 'Google+', 'behold_googleplus_callback', 'behold_theme_social_options', 'social_settings_section' ); add_settings_field( 'pinterest', 'Pinterest', 'behold_pinterest_callback', 'behold_theme_social_options', 'social_settings_section' ); add_settings_field( 'linkedin', 'LinkedIn', 'behold_linkedin_callback', 'behold_theme_social_options', 'social_settings_section' ); add_settings_field( 'rss', 'RSS', 'behold_rss_callback', 'behold_theme_social_options', 'social_settings_section' ); register_setting( 'behold_theme_social_options', 'behold_theme_social_options', 'behold_theme_sanitize_social_options' ); } add_action( 'admin_init', 'behold_theme_intialize_social_options' ); function behold_social_options_callback() { _e('

    Provide the URL to the social networks you\'d like to display. Leave it blank if you don\'t want to display the button.

    ', 'Behold'); } function behold_facebook_callback() { // First, we read the social options collection $options = get_option( 'behold_theme_social_options' ); // Next, we need to make sure the element is defined in the options. If not, we'll set an empty string. $url = ''; if( !isset( $options['facebook'] ) ) { $options['facebook'] = ''; } else { $url = $options['facebook']; } // end if // Render the output echo ''; } function behold_twitter_callback() { // First, we read the social options collection $options = get_option( 'behold_theme_social_options' ); // Next, we need to make sure the element is defined in the options. If not, we'll set an empty string. $url = ''; if( !isset( $options['twitter'] ) ) { $options['twitter'] = ''; } else { $url = $options['twitter']; } // end if // Render the output echo ''; } function behold_googleplus_callback() { // First, we read the social options collection $options = get_option( 'behold_theme_social_options' ); // Next, we need to make sure the element is defined in the options. If not, we'll set an empty string. $url = ''; if( !isset( $options['googleplus'] ) ) { $options['googleplus'] = ''; } else { $url = $options['googleplus']; } // end if // Render the output echo ''; } function behold_pinterest_callback() { // First, we read the social options collection $options = get_option( 'behold_theme_social_options' ); // Next, we need to make sure the element is defined in the options. If not, we'll set an empty string. $url = ''; if( !isset( $options['pinterest'] ) ) { $options['pinterest'] = ''; } else { $url = $options['pinterest']; } // end if // Render the output echo ''; } function behold_linkedin_callback() { // First, we read the social options collection $options = get_option( 'behold_theme_social_options' ); // Next, we need to make sure the element is defined in the options. If not, we'll set an empty string. $url = ''; if( !isset( $options['linkedin'] ) ) { $options['linkedin'] = ''; } else { $url = $options['linkedin']; } // end if // Render the output echo ''; } function behold_rss_callback() { // First, we read the social options collection $options = get_option( 'behold_theme_social_options' ); // Next, we need to make sure the element is defined in the options. If not, we'll set an empty string. $url = ''; if( !isset( $options['rss'] ) ) { $options['rss'] = ''; } else { $url = $options['rss']; } // end if // Render the output echo ''; } function behold_theme_sanitize_social_options( $input ) { // Define the array for the updated options $output = array(); // Loop through each of the options sanitizing the data foreach( $input as $key => $val ) { if( isset ( $input[$key] ) ) { $output[$key] = esc_url_raw( strip_tags( stripslashes( $input[$key] ) ) ); } // end if } // end foreach // Return the new collection return apply_filters( 'behold_theme_sanitize_social_options', $output, $input ); } function behold_theme_display() { ?>

    $excerpt_length ) { echo "

    " . substr( $the_excerpt, 0, $excerpt_length ) . "...

    "; } }