'loop-container', 'footer' => 'overflow-container', 'render' => 'ct_apex_infinite_scroll_render' ) ); load_theme_textdomain( 'apex', get_template_directory() . '/languages' ); register_nav_menus( array( 'primary' => __( 'Primary', 'apex' ) ) ); } } add_action( 'after_setup_theme', 'ct_apex_theme_setup', 10 ); if ( ! function_exists( ( 'ct_apex_register_widget_areas' ) ) ) { function ct_apex_register_widget_areas() { // after post content register_sidebar( array( 'name' => esc_html__( 'Primary Sidebar', 'apex' ), 'id' => 'primary', 'description' => esc_html__( 'Widgets in this area will be shown in the sidebar next to the main post content', 'apex' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); } } add_action( 'widgets_init', 'ct_apex_register_widget_areas' ); if ( ! function_exists( ( 'ct_apex_customize_comments' ) ) ) { function ct_apex_customize_comments( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; global $post; ?>
  • id="li-comment-">
    comment_approved == '0' ) : ?>

    '; $fields['email'] = '

    '; $fields['url'] = '

    '; return $fields; } } add_filter( 'comment_form_default_fields', 'ct_apex_update_fields' ); if ( ! function_exists( 'ct_apex_update_comment_field' ) ) { function ct_apex_update_comment_field( $comment_field ) { $comment_field = '

    '; return $comment_field; } } add_filter( 'comment_form_field_comment', 'ct_apex_update_comment_field' ); if ( ! function_exists( 'ct_apex_remove_comments_notes_after' ) ) { function ct_apex_remove_comments_notes_after( $defaults ) { $defaults['comment_notes_after'] = ''; return $defaults; } } add_action( 'comment_form_defaults', 'ct_apex_remove_comments_notes_after' ); if ( ! function_exists( 'ct_apex_excerpt' ) ) { function ct_apex_excerpt() { global $post; $read_more_text = get_theme_mod( 'read_more_text' ); $show_full_post = get_theme_mod( 'full_post' ); $ismore = strpos( $post->post_content, '' ); if ( ( $show_full_post == 'yes' ) && ! is_search() ) { if ( $ismore ) { // Has to be written this way because i18n text CANNOT be stored in a variable if ( ! empty( $read_more_text ) ) { the_content( esc_html( $read_more_text ) . " " . esc_html( get_the_title() ) . "" ); } else { the_content( __( 'Continue reading', 'apex' ) . " " . esc_html( get_the_title() ) . "" ); } } else { the_content(); } } elseif ( $ismore ) { if ( ! empty( $read_more_text ) ) { the_content( esc_html( $read_more_text ) . " " . esc_html( get_the_title() ) . "" ); } else { the_content( __( 'Continue reading', 'apex' ) . " " . esc_html( get_the_title() ) . "" ); } } else { the_excerpt(); } } } if ( ! function_exists( 'ct_apex_excerpt_read_more_link' ) ) { function ct_apex_excerpt_read_more_link( $output ) { $read_more_text = get_theme_mod( 'read_more_text' ); if ( ! empty( $read_more_text ) ) { return $output . "

    " . esc_html( $read_more_text ) . " " . esc_html( get_the_title() ) . "

    "; } else { return $output . "

    " . __( 'Continue reading', 'apex' ) . " " . esc_html( get_the_title() ) . "

    "; } } } add_filter( 'the_excerpt', 'ct_apex_excerpt_read_more_link' ); if ( ! function_exists( 'ct_apex_custom_excerpt_length' ) ) { function ct_apex_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_apex_custom_excerpt_length', 99 ); if ( ! function_exists( 'ct_apex_new_excerpt_more' ) ) { function ct_apex_new_excerpt_more( $more ) { $new_excerpt_length = get_theme_mod( 'excerpt_length' ); $excerpt_more = ( $new_excerpt_length === 0 ) ? '' : '…'; return $excerpt_more; } } add_filter( 'excerpt_more', 'ct_apex_new_excerpt_more' ); if ( ! function_exists( 'ct_apex_remove_more_link_scroll' ) ) { function ct_apex_remove_more_link_scroll( $link ) { $link = preg_replace( '|#more-[0-9]+|', '', $link ); return $link; } } add_filter( 'the_content_more_link', 'ct_apex_remove_more_link_scroll' ); if ( ! function_exists( 'ct_apex_featured_image' ) ) { function ct_apex_featured_image() { global $post; $featured_image = ''; if ( has_post_thumbnail( $post->ID ) ) { if ( is_singular() ) { $featured_image = ''; } else { $featured_image = ''; } } $featured_image = apply_filters( 'ct_apex_featured_image', $featured_image ); if ( $featured_image ) { echo $featured_image; } } } if ( ! function_exists( 'ct_apex_social_array' ) ) { function ct_apex_social_array() { $social_sites = array( 'twitter' => 'apex_twitter_profile', 'facebook' => 'apex_facebook_profile', 'google-plus' => 'apex_googleplus_profile', 'pinterest' => 'apex_pinterest_profile', 'linkedin' => 'apex_linkedin_profile', 'youtube' => 'apex_youtube_profile', 'vimeo' => 'apex_vimeo_profile', 'tumblr' => 'apex_tumblr_profile', 'instagram' => 'apex_instagram_profile', 'flickr' => 'apex_flickr_profile', 'dribbble' => 'apex_dribbble_profile', 'rss' => 'apex_rss_profile', 'reddit' => 'apex_reddit_profile', 'soundcloud' => 'apex_soundcloud_profile', 'spotify' => 'apex_spotify_profile', 'vine' => 'apex_vine_profile', 'yahoo' => 'apex_yahoo_profile', 'foursquare' => 'apex_foursquare_profile', 'slack' => 'apex_slack_profile', 'slideshare' => 'apex_slideshare_profile', 'skype' => 'apex_skype_profile', 'behance' => 'apex_behance_profile', 'codepen' => 'apex_codepen_profile', 'delicious' => 'apex_delicious_profile', 'stumbleupon' => 'apex_stumbleupon_profile', 'deviantart' => 'apex_deviantart_profile', 'digg' => 'apex_digg_profile', 'github' => 'apex_github_profile', 'hacker-news' => 'apex_hacker-news_profile', 'bandcamp' => 'apex_bandcamp_profile', 'etsy' => 'apex_etsy_profile', 'quora' => 'apex_quora_profile', 'ravelry' => 'apex_ravelry_profile', 'meetup' => 'apex_meetup_profile', 'telegram' => 'apex_telegram_profile', 'podcast' => 'apex_podcast_profile', 'whatsapp' => 'apex_whatsapp_profile', 'steam' => 'apex_steam_profile', 'qq' => 'apex_qq_profile', 'vk' => 'apex_vk_profile', 'weibo' => 'apex_weibo_profile', 'wechat' => 'apex_wechat_profile', 'xing' => 'apex_xing_profile', 'tencent-weibo' => 'apex_tencent_weibo_profile', '500px' => 'apex_500px_profile', 'paypal' => 'apex_paypal_profile', 'email' => 'apex_email_profile', 'email-form' => 'apex_email_form_profile' ); return apply_filters( 'ct_apex_social_array_filter', $social_sites ); } } if ( ! function_exists( 'ct_apex_social_icons_output' ) ) { function ct_apex_social_icons_output( $source ) { $social_sites = ct_apex_social_array(); $square_icons = array( 'linkedin', 'twitter', 'vimeo', 'youtube', 'pinterest', 'rss', 'reddit', 'tumblr', 'steam', 'xing', 'github', 'google-plus', 'behance', 'facebook' ); 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 "