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

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

'; return $o; } // Add Bootstrap classes for table add_filter( 'the_content', 'shapely_add_custom_table_class' ); function shapely_add_custom_table_class( $content ) { return preg_replace( '/(]*)class="([^"]*)")?/', '$1 $3 class="$4 table table-hover" ', $content ); } 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_id' => 'menu', 'theme_location' => 'primary', 'depth' => 3, 'container' => 'div', 'container_class' => 'collapse navbar-collapse navbar-ex1-collapse', 'menu_class' => 'menu', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker() ) ); } /* end header menu */ endif; /** * function to show the footer info, copyright information */ function shapely_footer_info() { printf( esc_html__( 'Theme by %1$s Powered by %2$s', 'shapely' ), 'Colorlib', 'WordPress' ); } if ( ! function_exists( 'get_shapely_theme_options' ) ) { /** * Get information from Theme Options and add it into wp_head */ function get_shapely_theme_options() { echo ''; } } add_action( 'wp_head', 'get_shapely_theme_options', 10 ); /** * Add Bootstrap thumbnail styling to images with captions * Use
and
* * @link http://justintadlock.com/archives/2011/07/01/captions-in-wordpress */ function shapely_caption( $output, $attr, $content ) { if ( is_feed() ) { return $output; } $defaults = array( 'id' => 'shapely_caption_' . rand( 1, 192282 ), '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; } $output = '
'; $output .= do_shortcode( $content ); $output .= '
' . esc_html( $attr['caption'] ) . '
'; $output .= '
'; return $output; } add_filter( 'img_caption_shortcode', 'shapely_caption', 10, 3 ); /** * 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 ) ? esc_url( $item->url ) : ''; } return $atts; } add_filter( 'nav_menu_link_attributes', 'shapely_add_top_level_menu_url', 99, 3 ); /** * Makes the top level navigation menu item clickable */ function shapely_make_top_level_menu_clickable() { if ( ! wp_is_mobile() ) { ?> ' . esc_html_x( 'Read More', 'Read More', 'shapely' ) . ''; } add_filter( 'excerpt_more', 'shapely_excerpt_more' ); /* * Pagination */ if ( ! function_exists( 'shapely_pagination' ) ) { function shapely_pagination() { ?>
'; return $form; } add_filter( 'get_search_form', 'shapely_search_form', 100 ); /* * Author bio on single page */ if ( ! function_exists( 'shapely_author_bio' ) ) { function shapely_author_bio() { if ( ! get_the_ID() ) { return; } $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_email = get_the_author_meta( 'email' ); $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; } /* * Header Logo */ function shapely_get_header_logo() { $logo_id = get_theme_mod( 'custom_logo', '' ); $logo = wp_get_attachment_image_src( $logo_id, 'full' ); ?> 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; } /* * Top Callout */ function shapely_top_callout() { if ( get_theme_mod( 'top_callout', true ) ) { $header = get_header_image(); ?>
    >

    >

    ', '

    ' ); ?>
    ', '

    ' ); ?>