'loop-container', 'footer' => 'overflow-container', 'render' => 'unlimited_infinite_scroll_render' ) ); require_once( trailingslashit( get_template_directory() ) . 'theme-options.php' ); foreach ( glob( trailingslashit( get_template_directory() ) . 'inc/*' ) as $filename ) { include $filename; } load_theme_textdomain( 'unlimited', get_template_directory() . '/languages' ); register_nav_menus( array( 'primary' => __( 'Primary', 'unlimited' ) ) ); } } add_action( 'after_setup_theme', 'unlimited_theme_setup', 10 ); function unlimited_register_widget_areas() { register_sidebar( array( 'name' => __( 'Primary Sidebar', 'unlimited' ), 'id' => 'primary', 'description' => __( 'Widgets in this area will be shown in the sidebar next to the main post content', 'unlimited' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); } add_action( 'widgets_init', 'unlimited_register_widget_areas' ); if ( ! function_exists( 'unlimited_customize_comments' ) ) { function unlimited_customize_comments( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; global $post; ?>
  • id="li-comment-">
    comment_approved == '0' ) : echo "" . __( 'Your comment is awaiting moderation.', 'unlimited' ) . "
    "; endif; comment_text(); ?>
    __( 'Reply', 'unlimited' ), 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '|' ) ) ); ?>

    '; $fields['email'] = '

    '; $fields['url'] = '

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

    '; return $comment_field; } } add_filter( 'comment_form_field_comment', 'unlimited_update_comment_field' ); if ( ! function_exists( 'unlimited_remove_comments_notes_after' ) ) { function unlimited_remove_comments_notes_after( $defaults ) { $defaults['comment_notes_after'] = ''; return $defaults; } } add_action( 'comment_form_defaults', 'unlimited_remove_comments_notes_after' ); if ( ! function_exists( 'unlimited_excerpt' ) ) { function unlimited_excerpt() { global $post; $ismore = strpos( $post->post_content, '' ); $show_full_post = get_theme_mod( 'full_post' ); $read_more_text = get_theme_mod( 'read_more_text' ); 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( $read_more_text . " " . get_the_title() . "" ); } else { the_content( __( 'Read More', 'unlimited' ) . " " . get_the_title() . "" ); } } else { the_content(); } } // use the read more link if present elseif ( $ismore ) { if ( ! empty( $read_more_text ) ) { the_content( $read_more_text . " " . get_the_title() . "" ); } else { the_content( __( 'Read More', 'unlimited' ) . " " . get_the_title() . "" ); } } // otherwise the excerpt is automatic, so output it else { the_excerpt(); } } } if ( ! function_exists( 'unlimited_excerpt_read_more_link' ) ) { function unlimited_excerpt_read_more_link( $output ) { $read_more_text = get_theme_mod( 'read_more_text' ); if ( ! empty( $read_more_text ) ) { return $output . "

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

    "; } else { return $output . "

    " . __( 'Read More', 'unlimited' ) . "" . get_the_title() . "

    "; } } } add_filter( 'the_excerpt', 'unlimited_excerpt_read_more_link' ); // switch [...] to ellipsis on automatic excerpt if ( ! function_exists( 'unlimited_new_excerpt_more' ) ) { function unlimited_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', 'unlimited_new_excerpt_more' ); if ( ! function_exists( 'unlimited_remove_more_link_scroll' ) ) { function unlimited_remove_more_link_scroll( $link ) { $link = preg_replace( '|#more-[0-9]+|', '', $link ); return $link; } } add_filter( 'the_content_more_link', 'unlimited_remove_more_link_scroll' ); function unlimited_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', 'unlimited_custom_excerpt_length', 99 ); if ( ! function_exists( 'unlimited_featured_image' ) ) { function unlimited_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_unlimited_featured_image', $featured_image ); if ( $featured_image ) { echo $featured_image; } } } if ( ! function_exists( 'unlimited_social_array' ) ) { function unlimited_social_array() { $social_sites = array( 'twitter' => 'unlimited_twitter_profile', 'facebook' => 'unlimited_facebook_profile', 'google-plus' => 'unlimited_google_plus_profile', 'pinterest' => 'unlimited_pinterest_profile', 'linkedin' => 'unlimited_linkedin_profile', 'youtube' => 'unlimited_youtube_profile', 'vimeo' => 'unlimited_vimeo_profile', 'tumblr' => 'unlimited_tumblr_profile', 'instagram' => 'unlimited_instagram_profile', 'flickr' => 'unlimited_flickr_profile', 'dribbble' => 'unlimited_dribbble_profile', 'rss' => 'unlimited_rss_profile', 'reddit' => 'unlimited_reddit_profile', 'soundcloud' => 'unlimited_soundcloud_profile', 'spotify' => 'unlimited_spotify_profile', 'vine' => 'unlimited_vine_profile', 'yahoo' => 'unlimited_yahoo_profile', 'behance' => 'unlimited_behance_profile', 'codepen' => 'unlimited_codepen_profile', 'delicious' => 'unlimited_delicious_profile', 'stumbleupon' => 'unlimited_stumbleupon_profile', 'deviantart' => 'unlimited_deviantart_profile', 'digg' => 'unlimited_digg_profile', 'github' => 'unlimited_github_profile', 'hacker-news' => 'unlimited_hacker-news_profile', 'foursquare' => 'unlimited_foursquare_profile', 'slack' => 'unlimited_slack_profile', 'slideshare' => 'unlimited_slideshare_profile', 'skype' => 'unlimited_skype_profile', 'whatsapp' => 'unlimited_whatsapp_profile', 'qq' => 'unlimited_qq_profile', 'wechat' => 'unlimited_wechat_profile', 'xing' => 'unlimited_xing_profile', '500px' => 'unlimited_500px_profile', 'steam' => 'unlimited_steam_profile', 'vk' => 'unlimited_vk_profile', 'paypal' => 'unlimited_paypal_profile', 'weibo' => 'unlimited_weibo_profile', 'tencent-weibo' => 'unlimited_tencent_weibo_profile', 'email' => 'unlimited_email_profile' ); return apply_filters( 'unlimited_social_array_filter', $social_sites ); } } if ( ! function_exists( 'unlimited_social_icons_output' ) ) { function unlimited_social_icons_output( $source ) { $social_sites = unlimited_social_array(); $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 ( $source == 'header' ) { if ( strlen( get_theme_mod( $social_site ) ) > 0 ) { $active_sites[ $social_site ] = $social_site; } } elseif ( $source == 'author' ) { if ( strlen( get_the_author_meta( $profile ) ) > 0 ) { $active_sites[ $profile ] = $social_site; } } } if ( ! empty( $active_sites ) ) { echo "