'loop-container', 'footer' => 'overflow-container', 'render' => 'ct_modern_store_infinite_scroll_render' ) ); add_theme_support( 'custom-logo', array( 'height' => 60, 'width' => 200, 'flex-height' => true, 'flex-width' => true ) ); // Add WooCommerce support add_theme_support( 'woocommerce' ); // Add support for WooCommerce image gallery features add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); add_image_size( 'homepage-thumb', 600, 600, true ); // (cropped) // Gutenberg - add support for editor styles add_theme_support('editor-styles'); // Gutenberg - wide images add_theme_support( 'align-wide' ); // Gutenberg - modify the font sizes add_theme_support( 'editor-font-sizes', array( array( 'name' => __( 'small', 'modern-store' ), 'shortName' => __( 'S', 'modern-store' ), 'size' => 12, 'slug' => 'small' ), array( 'name' => __( 'regular', 'modern-store' ), 'shortName' => __( 'M', 'modern-store' ), 'size' => 16, 'slug' => 'regular' ), array( 'name' => __( 'large', 'modern-store' ), 'shortName' => __( 'L', 'modern-store' ), 'size' => 21, 'slug' => 'large' ), array( 'name' => __( 'larger', 'modern-store' ), 'shortName' => __( 'XL', 'modern-store' ), 'size' => 28, 'slug' => 'larger' ) ) ); register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'modern-store' ), 'secondary' => esc_html__( 'Secondary', 'modern-store' ) ) ); load_theme_textdomain( 'modern-store', get_template_directory() . '/languages' ); } } add_action( 'after_setup_theme', 'ct_modern_store_theme_setup' ); //---------------------------------------------------------------------------------- // Register widget areas //---------------------------------------------------------------------------------- if ( ! function_exists( ( 'ct_modern_store_register_widget_areas' ) ) ) { function ct_modern_store_register_widget_areas() { register_sidebar( array( 'name' => esc_html__( 'Store Sidebar', 'modern-store' ), 'id' => 'store', 'description' => esc_html__( 'These widgets display in the sidebar of the store page', 'modern-store' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); } } add_action( 'widgets_init', 'ct_modern_store_register_widget_areas' ); //---------------------------------------------------------------------------------- // Customize comment markup //---------------------------------------------------------------------------------- if ( ! function_exists( ( 'ct_modern_store_customize_comments' ) ) ) { function ct_modern_store_customize_comments( $comment, $args, $depth ) { ?>
  • id="li-comment-">
    comment_approved == '0' ) : ?>
    post_content, '' ); $read_more_text = get_theme_mod( 'read_more_text' ); $new_excerpt_length = get_theme_mod( 'excerpt_length' ); $excerpt_more = ( $new_excerpt_length === 0 ) ? '' : '…'; $output = ''; // add ellipsis for automatic excerpts if ( empty( $ismore ) && $custom !== true ) { $output .= $excerpt_more; } // Because i18n text cannot be stored in a variable if ( empty( $read_more_text ) ) { $output .= ''; } else { $output .= ''; } return $output; } } add_filter( 'the_content_more_link', 'ct_modern_store_filter_read_more_link' ); // more tags add_filter( 'excerpt_more', 'ct_modern_store_filter_read_more_link', 10 ); // automatic excerpts //---------------------------------------------------------------------------------- // Add more link to excerpts //---------------------------------------------------------------------------------- if ( ! function_exists( 'ct_modern_store_filter_manual_excerpts' ) ) { function ct_modern_store_filter_manual_excerpts( $excerpt ) { $excerpt_more = ''; if ( has_excerpt() ) { $excerpt_more = ct_modern_store_filter_read_more_link( true ); } return $excerpt . $excerpt_more; } } add_filter( 'get_the_excerpt', 'ct_modern_store_filter_manual_excerpts' ); //---------------------------------------------------------------------------------- // Output content VS excerpt based on user settings //---------------------------------------------------------------------------------- if ( ! function_exists( 'ct_modern_store_excerpt' ) ) { function ct_modern_store_excerpt() { global $post; $show_full_post = get_theme_mod( 'full_post' ); $ismore = strpos( $post->post_content, '' ); if ( $show_full_post === 'yes' || $ismore ) { the_content(); } else { the_excerpt(); } } } //---------------------------------------------------------------------------------- // Update automatic excerpt word count based on user settings //---------------------------------------------------------------------------------- if ( ! function_exists( 'ct_modern_store_custom_excerpt_length' ) ) { function ct_modern_store_custom_excerpt_length( $length ) { $new_excerpt_length = get_theme_mod( 'excerpt_length' ); if ( ! empty( $new_excerpt_length ) && $new_excerpt_length != 25 ) { return $new_excerpt_length; } elseif ( $new_excerpt_length === 0 ) { return 0; } else { return 25; } } } add_filter( 'excerpt_length', 'ct_modern_store_custom_excerpt_length', 99 ); //---------------------------------------------------------------------------------- // Turn off scrolling to after excerpt after clicking 'read more' link //---------------------------------------------------------------------------------- if ( ! function_exists( 'ct_modern_store_remove_more_link_scroll' ) ) { function ct_modern_store_remove_more_link_scroll( $link ) { $link = preg_replace( '|#more-[0-9]+|', '', $link ); return $link; } } add_filter( 'the_content_more_link', 'ct_modern_store_remove_more_link_scroll' ); //---------------------------------------------------------------------------------- // Output Featured Image //---------------------------------------------------------------------------------- if ( ! function_exists( 'ct_modern_store_featured_image' ) ) { function ct_modern_store_featured_image() { global $post; $featured_image = ''; if ( has_post_thumbnail( $post->ID ) ) { $featured_image = ''; } $featured_image = apply_filters( 'ct_modern_store_featured_image', $featured_image ); if ( $featured_image ) { echo $featured_image; } } } //---------------------------------------------------------------------------------- // Return array of all social sites and IDs //---------------------------------------------------------------------------------- if ( ! function_exists( 'ct_modern_store_social_array' ) ) { function ct_modern_store_social_array() { $social_sites = array( 'twitter' => 'ct_modern_store_twitter_profile', 'facebook' => 'ct_modern_store_facebook_profile', 'instagram' => 'ct_modern_store_instagram_profile', 'linkedin' => 'ct_modern_store_linkedin_profile', 'pinterest' => 'ct_modern_store_pinterest_profile', 'google-plus' => 'ct_modern_store_googleplus_profile', 'youtube' => 'ct_modern_store_youtube_profile', 'email' => 'ct_modern_store_email_profile', 'phone' => 'ct_modern_store_phone_profile', 'email-form' => 'ct_modern_store_email_form_profile', 'amazon' => 'ct_modern_store_amazon_profile', 'artstation' => 'ct_modern_store_artstation_profile', 'bandcamp' => 'ct_modern_store_bandcamp_profile', 'behance' => 'ct_modern_store_behance_profile', 'bitbucket' => 'ct_modern_store_bitbucket_profile', 'codepen' => 'ct_modern_store_codepen_profile', 'delicious' => 'ct_modern_store_delicious_profile', 'deviantart' => 'ct_modern_store_deviantart_profile', 'digg' => 'ct_modern_store_digg_profile', 'discord' => 'ct_modern_store_discord_profile', 'dribbble' => 'ct_modern_store_dribbble_profile', 'etsy' => 'ct_modern_store_etsy_profile', 'flickr' => 'ct_modern_store_flickr_profile', 'foursquare' => 'ct_modern_store_foursquare_profile', 'github' => 'ct_modern_store_github_profile', 'goodreads' => 'ct_modern_store_goodreads_profile', 'google-wallet' => 'ct_modern_store_google_wallet_profile', 'hacker-news' => 'ct_modern_store_hacker-news_profile', 'medium' => 'ct_modern_store_medium_profile', 'meetup' => 'ct_modern_store_meetup_profile', 'mixcloud' => 'ct_modern_store_mixcloud_profile', 'ok-ru' => 'ct_modern_store_ok_ru_profile', 'patreon' => 'ct_modern_store_patreon_profile', 'paypal' => 'ct_modern_store_paypal_profile', 'podcast' => 'ct_modern_store_podcast_profile', 'quora' => 'ct_modern_store_quora_profile', 'qq' => 'ct_modern_store_qq_profile', 'ravelry' => 'ct_modern_store_ravelry_profile', 'reddit' => 'ct_modern_store_reddit_profile', 'rss' => 'ct_modern_store_rss_profile', 'skype' => 'ct_modern_store_skype_profile', 'slack' => 'ct_modern_store_slack_profile', 'slideshare' => 'ct_modern_store_slideshare_profile', 'snapchat' => 'ct_modern_store_snapchat_profile', 'soundcloud' => 'ct_modern_store_soundcloud_profile', 'spotify' => 'ct_modern_store_spotify_profile', 'stack-overflow' => 'ct_modern_store_stack_overflow_profile', 'steam' => 'ct_modern_store_steam_profile', 'stumbleupon' => 'ct_modern_store_stumbleupon_profile', 'telegram' => 'ct_modern_store_telegram_profile', 'tencent-weibo' => 'ct_modern_store_tencent_weibo_profile', 'tumblr' => 'ct_modern_store_tumblr_profile', 'twitch' => 'ct_modern_store_twitch_profile', 'vimeo' => 'ct_modern_store_vimeo_profile', 'vine' => 'ct_modern_store_vine_profile', 'vk' => 'ct_modern_store_vk_profile', 'wechat' => 'ct_modern_store_wechat_profile', 'weibo' => 'ct_modern_store_weibo_profile', 'whatsapp' => 'ct_modern_store_whatsapp_profile', 'xing' => 'ct_modern_store_xing_profile', 'yahoo' => 'ct_modern_store_yahoo_profile', 'yelp' => 'ct_modern_store_yelp_profile', '500px' => 'ct_modern_store_500px_profile' ); return apply_filters( 'ct_modern_store_social_array_filter', $social_sites ); } } //---------------------------------------------------------------------------------- // Output social iconss //---------------------------------------------------------------------------------- if ( ! function_exists( 'ct_modern_store_social_icons_output' ) ) { function ct_modern_store_social_icons_output() { $social_sites = ct_modern_store_social_array(); // store the site name and url foreach ( $social_sites as $social_site => $profile ) { if ( strlen( get_theme_mod( $social_site ) ) > 0 ) { $active_sites[ $social_site ] = $social_site; } } if ( ! empty( $active_sites ) ) { echo ""; } } } /* * WP will apply the ".menu-primary-items" class & id to the containing
    instead of