ID, 'author_portfolio_sidebar-settings', true ); if ('customizer' === $indvPageSidebarSettings || empty($indvPageSidebarSettings)) { $sidebar_layouts = $get_page_sidebar_settings; }else{ $sidebar_layouts = $indvPageSidebarSettings; } $classes[] = $sidebar_layouts . '-sidebar'; }elseif (is_single()) { $get_post_sidebar_settings = get_theme_mod('post_sidebar', 'no'); $sidebar_layouts = $get_post_sidebar_settings; $classes[] = $get_post_sidebar_settings . '-sidebar'; } // Adds a class of no-sidebar when there is no sidebar present. if ( ! is_active_sidebar( 'sidebar-1' ) ) { $classes[] = 'no-sidebar'; } return $classes; } add_filter( 'body_class', 'author_portfolio_body_classes' ); /** * Add a pingback url auto-discovery header for single posts, pages, or attachments. */ function author_portfolio_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } add_action( 'wp_head', 'author_portfolio_pingback_header' ); if ( ! function_exists( 'author_portfolio_comment_list' ) ) : /** * Template for comments and pingbacks. * * Used as a callback by wp_list_comments() for displaying the comments. * * @since Shape 1.0 */ function author_portfolio_comment_list( $comment, $args, $depth ) { extract( $args, EXTR_SKIP ); if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
comment_approved == '0' ) : ?>

$depth, 'max_depth' => $args['max_depth'], 'before' => '
', 'after' => '
', ) ) ); ?>

1 ) { $numberingtext = 'posts'; } else { $numberingtext = 'post'; } $userposts = esc_html__( 'The author has %1$s %2$s', 'author-portfolio' ); printf( $userposts, $userpost_count, $numberingtext ); ?>

get( 'AuthorURI' ); } /** * Masonry Layout Control */ function author_portfolio_masonry_layout_control(){ $get_masonry_layout = get_theme_mod('active_masonry_layout', true); if (true === $get_masonry_layout) { return ' masonry_active'; } return ''; } /** * Limit Excerpt length */ function author_portfolio_post_excerpt_limit( $length ) { $length = get_theme_mod('post_loop_excerpt_limit', 42); return $length; } add_filter( 'excerpt_length', 'author_portfolio_post_excerpt_limit', 999 ); /** * Social Links */ function author_portfolio_social_links(){ $social_media_fields = array( 'facebook' => 'Facebook', 'twitter' => 'Twitter', 'instagram' => 'Instagram', 'tiktok' => 'Tiktok', 'linkedin' => 'Linkedin', 'pinterest' => 'Pinterest', 'line' => 'Line', 'github' => 'Github', 'discord' => 'Discord', 'youtube' => 'Youtube', 'wordpress' => 'WordPress', 'slack' => 'Slack', 'apple' => 'Apple', 'stack-overflow' => 'Stack-overflow', 'kickstarter' => 'kickstarter', 'dribbble' => 'Dribbble', 'codepen' => 'Codepen', 'whatsapp' => 'Whatsapp', 'medium' => 'Medium', 'goodreads-g' => 'Goodreads' ); $linkItem = ''; foreach ( $social_media_fields as $field => $label ) { $value = get_theme_mod( $field, '#' ); if ( ! empty( $value ) && '#' != $value) { $linkItem .= ''; } } wp_reset_query(); return $linkItem; } function author_portfolio_get_books_layout(){ $getBooksLayout = get_theme_mod('books_layout', 'product'); return $getBooksLayout; } function author_portfolio_template_chooser($template){ global $wp_query; $post_type = get_query_var('post_type'); if( $wp_query->is_search && $post_type == 'books-gallery' ) { return locate_template('search-books.php'); // redirect to archive-search.php } return $template; } add_filter('template_include', 'author_portfolio_template_chooser'); add_action('admin_menu', 'author_portfolio_personalize'); function author_portfolio_personalize(){ remove_submenu_page( 'sb-instagram-feed', 'sb-instagram-feed-about' ); } add_action('sbi_before_feed', 'author_portfolio_sbi_before_feed'); function author_portfolio_sbi_before_feed(){ ?>