'loop-container', 'footer' => 'overflow-container', 'render' => 'ct_author_infinite_scroll_render' ) ); // load theme options page require_once( trailingslashit( get_template_directory() ) . 'theme-options.php' ); // add inc folder files foreach ( glob( trailingslashit( get_template_directory() ) . 'inc/*' ) as $filename ) { include $filename; } // load text domain load_theme_textdomain( 'author', get_template_directory() . '/languages' ); // register Primary menu register_nav_menus( array( 'primary' => __( 'Primary', 'author' ) ) ); } } add_action( 'after_setup_theme', 'ct_author_theme_setup', 10 ); // register widget areas function ct_author_register_widget_areas(){ /* register after post content widget area */ register_sidebar( array( 'name' => __( 'Primary Sidebar', 'author' ), 'id' => 'primary', 'description' => __( 'Widgets in this area will be shown in the sidebar', 'author' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); } add_action('widgets_init','ct_author_register_widget_areas'); /* added to customize the comments. Same as default except -> added use of gravatar images for comment authors */ if( !function_exists('ct_author_customize_comments' ) ) { function ct_author_customize_comments( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; $comment_type = $comment->comment_type; ?>
  • id="li-comment-">
    comment_author_email === get_option( 'admin_email' ) && get_theme_mod( 'avatar_method' ) == 'upload' ) { echo '' . get_comment_author() . ''; } else { echo get_avatar( get_comment_author_email(), 48, '', get_comment_author() ); } } ?>
    comment_approved == '0' ) : ?>

    '; $fields['email'] = '

    '; $fields['url'] = '

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

    '; return $comment_field; } } add_filter('comment_form_field_comment','ct_author_update_comment_field'); // remove allowed tags text after comment form if( !function_exists('ct_author_remove_comments_notes_after' ) ) { function ct_author_remove_comments_notes_after( $defaults ) { $defaults['comment_notes_after'] = ''; return $defaults; } } add_action('comment_form_defaults', 'ct_author_remove_comments_notes_after'); // excerpt handling if( ! function_exists( 'ct_author_excerpt' ) ) { function ct_author_excerpt() { // make post variable available global $post; // check for the more tag $ismore = strpos( $post->post_content, '' ); // get the show full post setting $show_full_post = get_theme_mod( 'full_post' ); // if show full post is on and not on a search results page if ( ( $show_full_post == 'yes' ) && ! is_search() ) { // use the read more link if present if ( $ismore ) { the_content( __( 'Continue reading', 'author' ) . " " . get_the_title() . "" ); } else { the_content(); } } // use the read more link if present elseif ( $ismore ) { the_content( __( 'Continue reading', 'author' ) . " " . get_the_title() . "" ); } // otherwise the excerpt is automatic, so output it else { the_excerpt(); } } } // filter the link on excerpts if( !function_exists('ct_author_excerpt_read_more_link' ) ) { function ct_author_excerpt_read_more_link( $output ) { global $post; return $output . "

    " . __( 'Continue reading', 'author' ) . " " . get_the_title() . "

    "; } } add_filter('the_excerpt', 'ct_author_excerpt_read_more_link'); // change the length of the excerpts function ct_author_custom_excerpt_length( $length ) { $new_excerpt_length = get_theme_mod('excerpt_length'); // if there is a new length set and it's not 15, change it if( ! empty( $new_excerpt_length ) && $new_excerpt_length != 25 ){ return $new_excerpt_length; } // allow 0 to be an option if user wants to remove the excerpt entirely elseif( $new_excerpt_length === 0 ) { return 0; } else { return 25; } } add_filter( 'excerpt_length', 'ct_author_custom_excerpt_length', 99 ); // switch [...] to ellipsis on automatic excerpt if( !function_exists('ct_author_new_excerpt_more' ) ) { function ct_author_new_excerpt_more( $more ) { // get user set excerpt length $new_excerpt_length = get_theme_mod('excerpt_length'); // don't return trailing ellipsis if user removed excerpt if( $new_excerpt_length === 0 ) { return ''; } else { return '…'; } } } add_filter('excerpt_more', 'ct_author_new_excerpt_more'); // turns of the automatic scrolling to the read more link if( !function_exists('ct_author_remove_more_link_scroll' ) ) { function ct_author_remove_more_link_scroll( $link ) { $link = preg_replace( '|#more-[0-9]+|', '', $link ); return $link; } } add_filter( 'the_content_more_link', 'ct_author_remove_more_link_scroll' ); // for displaying featured images if( !function_exists('ct_author_featured_image' ) ) { function ct_author_featured_image() { // get post object global $post; // establish featured image var $featured_image = ''; // if post has an image if ( has_post_thumbnail( $post->ID ) ) { if ( is_singular() ) { $featured_image = ''; } else { $featured_image = ''; } } // allow videos to be added $featured_image = apply_filters( 'ct_author_featured_image', $featured_image ); if( $featured_image ) { echo $featured_image; } } } // associative array of social media sites if( !function_exists( 'ct_author_social_array' ) ) { function ct_author_social_array() { $social_sites = array( 'twitter' => 'author_twitter_profile', 'facebook' => 'author_facebook_profile', 'google-plus' => 'author_googleplus_profile', 'pinterest' => 'author_pinterest_profile', 'linkedin' => 'author_linkedin_profile', 'youtube' => 'author_youtube_profile', 'vimeo' => 'author_vimeo_profile', 'tumblr' => 'author_tumblr_profile', 'instagram' => 'author_instagram_profile', 'flickr' => 'author_flickr_profile', 'dribbble' => 'author_dribbble_profile', 'rss' => 'author_rss_profile', 'reddit' => 'author_reddit_profile', 'soundcloud' => 'author_soundcloud_profile', 'spotify' => 'author_spotify_profile', 'vine' => 'author_vine_profile', 'yahoo' => 'author_yahoo_profile', 'behance' => 'author_behance_profile', 'codepen' => 'author_codepen_profile', 'delicious' => 'author_delicious_profile', 'stumbleupon' => 'author_stumbleupon_profile', 'deviantart' => 'author_deviantart_profile', 'digg' => 'author_digg_profile', 'github' => 'author_github_profile', 'hacker-news' => 'author_hacker-news_profile', 'foursquare' => 'author_foursquare_profile', 'slack' => 'author_slack_profile', 'slideshare' => 'author_slideshare_profile', 'skype' => 'author_skype_profile', 'whatsapp' => 'author_whatsapp_profile', 'qq' => 'author_qq_profile', 'wechat' => 'author_wechat_profile', 'xing' => 'author_xing_profile', '500px' => 'author_500px_profile', 'paypal' => 'author_paypal_profile', 'steam' => 'author_steam_profile', 'vk' => 'author_vk_profile', 'weibo' => 'author_weibo_profile', 'tencent-weibo' => 'author_tencent_weibo_profile', 'email' => 'author_email_profile' ); return apply_filters( 'ct_author_social_array_filter', $social_sites ); } } // output social icons if( ! function_exists('ct_author_social_icons_output') ) { function ct_author_social_icons_output() { // get social sites array $social_sites = ct_author_social_array(); // icons that should use a special square icon $square_icons = array('linkedin', 'twitter', 'vimeo', 'youtube', 'pinterest', 'rss', 'reddit', 'tumblr', 'steam', 'xing', 'github', 'google-plus', 'behance', 'facebook'); // 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; } } // for each active social site, add it as a list item if ( ! empty( $active_sites ) ) { echo "
    "; } } } /* * WP will apply the ".menu-primary-items" class & id to the containing
    instead of