'main', 'render' => '_swank_infinite_scroll_render', 'footer' => 'page', 'footer_widgets' => array( 'sidebar-1', 'sidebar-2', 'sidebar-3', 'sidebar-4' ), 'wrapper' => true, ); add_theme_support( 'infinite-scroll', $infinite_scroll_options ); /** RESPONSIVE VIDEO SUPPORT @link https://jetpack.me/support/infinite-scroll/ **/ add_theme_support( 'jetpack-responsive-videos' ); /** TONESQUE SUPPORT **/ add_theme_support( 'tonesque' ); } // end function _swank_jetpack_setup add_action( 'after_setup_theme', '_swank_jetpack_setup' ); endif; /** INFINITE SCROLL CUSTOM RENDER **/ if ( ! function_exists( '_swank_infinite_scroll_render' ) ) : function _swank_infinite_scroll_render() { while ( have_posts() ) { the_post(); get_template_part( 'template-parts/content', get_post_format() ); } } // end function _swank_infinite_scroll_render endif; /** TONESQUE CUSTOM CSS **/ if ( ! function_exists( '_swank_tonesque_css' ) ) : function _swank_tonesque_css() { if ( ! current_theme_supports( 'tonesque' ) || ! class_exists( 'Tonesque' ) ) { return; } else { $tonesque = get_post_meta( get_the_ID(), '_swank_tonesque', true ); if ( empty( $tonesque ) ) { $output = preg_match_all( '//i', get_the_content(), $matches ); if ( empty( $matches[1][0] ) ) return; $tonesque = new Tonesque( $matches[1][0] ); $tonesque = array( 'color' => $tonesque->color(), 'contrast' => $tonesque->contrast(), ); if ( $tonesque['color'] ) update_post_meta( get_the_ID(), '_swank_tonesque', $tonesque ); else return; } extract( $tonesque ); if ( empty( $color ) || empty( $contrast ) ) return; $postid = '#post-' . get_the_ID(); echo ""; } } /** * Flush out the post meta used in _swank_tonesque_css(). * * @param int $post_id The ID of the saved post. */ function _swank_tonesque_post_meta_flusher( $post_id ) { delete_post_meta( $post_id, '_swank_tonesque' ); } add_action( 'save_post', '_swank_tonesque_post_meta_flusher' ); endif;