ID ) ? rand() : $post->ID ); $o = '

' . __( "This post is password protected. To view it please enter your password below:", 'shapely' ) . '

'; return $o; } // hook our function add_filter( 'the_password_form', 'shapely_custom_password_form' ); } if ( ! function_exists( 'shapely_add_custom_table_class' ) ) { /** * Add Bootstrap classes for table * * @param $content * * @return mixed */ function shapely_add_custom_table_class( $content ) { return preg_replace( '/(]*)class="([^"]*)")?/', '$1 $3 class="$4 table table-hover" ', $content ); } add_filter( 'the_content', 'shapely_add_custom_table_class' ); } if ( ! function_exists( 'shapely_header_menu' ) ) : /** * Header menu (should you choose to use one) */ function shapely_header_menu() { // display the WordPress Custom Menu if available wp_nav_menu( array( 'menu' => 'primary', 'menu_id' => 'menu', 'theme_location' => 'primary', 'depth' => 3, 'container' => 'div', 'container_class' => 'collapse navbar-collapse navbar-ex1-collapse', 'menu_class' => 'menu', 'fallback_cb' => 'shapely_navwalker::fallback', 'walker' => new shapely_navwalker(), ) ); } /* end header menu */ endif; if ( ! function_exists( 'shapely_footer_info' ) ) { /** * function to show the footer info, copyright information */ function shapely_footer_info() { $shapely_footer_link_attribution = get_theme_mod( 'shapely_footer_attribution_enable', 0 ); if ( $shapely_footer_link_attribution == 0 ) { printf( esc_html__( 'Theme by %1$s Powered by %2$s', 'shapely' ), '' . __( 'Colorlib', 'shapely' ) . '', '' . __( 'WordPress', 'shapely' ) . '' ); } } } if ( ! function_exists( 'shapely_get_theme_options' ) ) { /** * Get information from Theme Options and add it into wp_head */ function shapely_get_theme_options() { echo ''; } // hook our function add_action( 'wp_head', 'shapely_get_theme_options', 10 ); } if ( ! function_exists( 'shapely_bootstrap_image_caption' ) ) { /** * Add Bootstrap thumbnail styling to images with captions * Use
and
* * @link http://justintadlock.com/archives/2011/07/01/captions-in-wordpress */ function shapely_bootstrap_image_caption( $output, $attr, $content ) { if ( is_feed() ) { return $output; } $defaults = array( 'id' => '', 'align' => 'alignnone', 'width' => '', 'caption' => '', ); $attr = shortcode_atts( $defaults, $attr ); // If the width is less than 1 or there is no caption, return the content wrapped between the [caption] tags if ( $attr['width'] < 1 || empty( $attr['caption'] ) ) { return $content; } // Set up the attributes for the caption
$attributes = ( ! empty( $attr['id'] ) ? ' id="' . esc_attr( $attr['id'] ) . '"' : '' ); $attributes .= ' class="thumbnail wp-caption ' . esc_attr( $attr['align'] ) . '"'; $attributes .= ' style="width: ' . ( esc_attr( $attr['width'] ) + 10 ) . 'px"'; $output = ''; $output .= do_shortcode( $content ); $output .= '
' . $attr['caption'] . '
'; $output .= '
'; return $output; } add_filter( 'img_caption_shortcode', 'shapely_caption', 10, 3 ); } if ( ! function_exists( 'shapely_allow_skype_protocol' ) ) { /** * Skype URI support for social media icons */ function shapely_allow_skype_protocol( $protocols ) { $protocols[] = 'skype'; return $protocols; } add_filter( 'kses_allowed_protocols', 'shapely_allow_skype_protocol' ); } if ( ! function_exists( 'shapely_add_top_level_menu_url' ) ) { /** * Adds the URL to the top level navigation menu item */ function shapely_add_top_level_menu_url( $atts, $item, $args ) { if ( ! wp_is_mobile() && isset( $args->has_children ) && $args->has_children ) { $atts['href'] = ! empty( $item->url ) ? $item->url : ''; } return $atts; } add_filter( 'nav_menu_link_attributes', 'shapely_add_top_level_menu_url', 99, 3 ); } if ( ! function_exists( 'shapely_make_top_level_menu_clickable' ) ) { /** * Makes the top level navigation menu item clickable */ function shapely_make_top_level_menu_clickable() { if ( ! wp_is_mobile() ) { ?> ' . __( 'Read More', 'shapely' ) . ''; } add_filter( 'excerpt_more', 'shapely_excerpt_more' ); } if ( ! function_exists( 'shapely_search_form' ) ) { /** * Search Widget */ function shapely_search_form( $form ) { $form = ''; return $form; } add_filter( 'get_search_form', 'shapely_search_form', 100 ); } if ( ! function_exists( 'shapely_admin_style' ) ) { /** * Admin Css */ function shapely_admin_style() { echo ''; } add_action( 'admin_head', 'shapely_admin_style' ); add_action( 'customize_controls_print_styles', 'shapely_admin_style' ); } if ( ! function_exists( 'shapely_author_extra_social_links' ) ) { /** * Function used to register more social profiles on the w.org admin back-end -> user profile. * * @param $user */ function shapely_author_extra_social_links( $user ) { echo ''; } // hook our functions add_action( 'show_user_profile', 'shapely_author_extra_social_links' ); add_action( 'edit_user_profile', 'shapely_author_extra_social_links' ); } if ( ! function_exists( 'shapely_save_extra_social_links' ) ) { /** * @param $user_id */ function shapely_save_extra_social_links( $user_id ) { update_user_meta( $user_id, 'facebook_profile', sanitize_text_field( $_POST['facebook_profile'] ) ); update_user_meta( $user_id, 'twitter_profile', sanitize_text_field( $_POST['twitter_profile'] ) ); update_user_meta( $user_id, 'github_profile', sanitize_text_field( $_POST['github_profile'] ) ); update_user_meta( $user_id, 'dribble_profile', sanitize_text_field( $_POST['dribble_profile'] ) ); update_user_meta( $user_id, 'vimeo_profile', sanitize_text_field( $_POST['vimeo_profile'] ) ); } //hook our functions add_action( 'personal_options_update', 'shapely_save_extra_social_links' ); add_action( 'edit_user_profile_update', 'shapely_save_extra_social_links' ); } if ( ! function_exists( 'shapely_author_bio' ) ) { /** * Function that handles the display of author bio on single page */ function shapely_author_bio() { if ( ! get_the_ID() ) { return; } $author_fields = "'user_url','display_name', 'nickname', 'first_name','last_name','description', 'ID'"; $author_displayname = get_the_author_meta( 'display_name' ); $author_nickname = get_the_author_meta( 'nickname' ); $author_fullname = ( get_the_author_meta( 'first_name' ) != "" && get_the_author_meta( 'last_name' ) != "" ) ? get_the_author_meta( 'first_name' ) . " " . get_the_author_meta( 'last_name' ) : ""; $author_url = get_the_author_meta( 'user_url' ); $author_description = get_the_author_meta( 'description' ); $author_name = ( trim( $author_nickname ) != "" ) ? $author_nickname : ( trim( $author_displayname ) != "" ) ? $author_displayname : $author_fullname; ?>
  • id="comment-">
    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'], ) ) ); ?> comment_approved == '0' ) : ?>


  • '', 'email' => '', 'url' => '', ); $comments_args = array( 'label_submit' => __( 'Leave Comment', 'shapely' ), 'comment_field' => '', 'fields' => apply_filters( 'comment_form_default_fields', $fields ), ); return $comments_args; } } if ( ! function_exists( 'shapely_get_header_logo' ) ) { /** * Header Logo */ function shapely_get_header_logo() { $logo_id = get_theme_mod( 'custom_logo', '' ); $logo = wp_get_attachment_image_src( $logo_id, 'full' ); echo ''; if ( ! empty( $logo ) ) { echo ''; } else { echo '

    ' . esc_html( get_bloginfo( 'name' ) ) . '

    '; } echo '
    '; } } if ( ! function_exists( 'shapely_get_layout_class' ) ) { /** * Get layout class from single page * then from themeoptions */ function shapely_get_layout_class() { global $post; if ( is_singular() && get_post_meta( $post->ID, 'site_layout', true ) ) { $layout_class = get_post_meta( $post->ID, 'site_layout', true ); } else { $layout_class = get_theme_mod( 'shapely_sidebar_position', 'side-right' ); } return $layout_class; } } if ( ! function_exists( 'shapely_show_sidebar' ) ) { /** * Show Sidebar or not */ function shapely_show_sidebar() { global $post; $show_sidebar = true; if ( is_singular() && ( get_post_meta( $post->ID, 'site_layout', true ) ) ) { if ( get_post_meta( $post->ID, 'site_layout', true ) == 'no-sidebar' || get_post_meta( $post->ID, 'site_layout', true ) == 'full-width' ) { $show_sidebar = false; } } elseif ( get_theme_mod( 'shapely_sidebar_position' ) == "no-sidebar" || get_theme_mod( 'shapely_sidebar_position' ) == "full-width" ) { $show_sidebar = false; } return $show_sidebar; } } if ( ! function_exists( 'shapely_top_callout' ) ) { /** * Top Callout */ function shapely_top_callout() { if ( get_theme_mod( 'top_callout', true ) ) { ?>

    ', '

    ' ); } ?>
    ', '

    ' ); ?>