= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'simplecatch' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'simplecatch_wp_title', 10, 2 ); /** * Sets the post excerpt length to 30 words. * * function tied to the excerpt_length filter hook. * @uses filter excerpt_length */ function simplecatch_excerpt_length( $length ) { global $simplecatch_options_settings; $options = $simplecatch_options_settings; return $options[ 'excerpt_length' ]; } add_filter( 'excerpt_length', 'simplecatch_excerpt_length' ); /** * Returns a "Continue Reading" link for excerpts */ function simplecatch_continue_reading() { global $simplecatch_options_settings; $options = $simplecatch_options_settings; $more_tag_text = $options[ 'more_tag_text' ]; return ' ' . sprintf( __( '%s', 'simplecatch' ), esc_attr( $more_tag_text ) ) . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with simplecatch_continue_reading(). * */ function simplecatch_excerpt_more( $more ) { return ' …' . simplecatch_continue_reading(); } add_filter( 'excerpt_more', 'simplecatch_excerpt_more' ); /** * Adds Continue Reading link to post excerpts. * * function tied to the get_the_excerpt filter hook. */ function simplecatch_custom_excerpt( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= simplecatch_continue_reading(); } return $output; } add_filter( 'get_the_excerpt', 'simplecatch_custom_excerpt' ); if ( ! function_exists( 'simplecatch_headerdetails' ) ) : /** * Get the header logo Image from theme options * * @uses header logo * @get the data value of image from theme options * @display Header Image logo * * @uses default logo if logo field on theme options is empty * * @uses set_transient and delete_transient */ function simplecatch_headerdetails() { //delete_transient( 'simplecatch_headerdetails' ); global $simplecatch_options_settings; $options = $simplecatch_options_settings; if ( ( !$simplecatch_headerdetails = get_transient( 'simplecatch_headerdetails' ) ) && ( !empty( $options[ 'featured_logo_header' ] ) || empty( $options[ 'remove_site_title' ] ) || empty( $options[ 'remove_site_description' ] ) ) ) { echo ''; $simplecatch_headerdetails = '
'; if( empty ($options[ 'remove_header_logo' ] ) ) { $simplecatch_headerdetails .= '

'; // if not empty featured_logo_footer on theme options if ( !empty( $options[ 'featured_logo_header' ] ) ) : $simplecatch_headerdetails .= ''.get_bloginfo( 'name' ).''; else: // if empty featured_logo_footer on theme options, display default Header Logo $simplecatch_headerdetails .='logo'; endif; $simplecatch_headerdetails .= '

'; } if( empty( $options[ 'remove_site_title' ] ) || empty( $options[ 'remove_site_description' ] ) ) { $simplecatch_headerdetails .= '
'; if ( empty( $options[ 'remove_site_title' ] ) ) { $simplecatch_headerdetails .= '

'.esc_attr( get_bloginfo( 'name', 'display' ) ).'

'; } if ( empty( $options[ 'remove_site_description' ] ) ) { $simplecatch_headerdetails .= '

'.esc_attr( get_bloginfo( 'description' ) ).'

'; } $simplecatch_headerdetails .= '
'; } $simplecatch_headerdetails .= '
'; set_transient( 'simplecatch_headerdetails', $simplecatch_headerdetails, 86940 ); } echo $simplecatch_headerdetails; } endif; // simplecatch_headerdetails if ( ! function_exists( 'simplecatch_footerlogo' ) ) : /** * Get the footer logo Image from theme options * * @uses footer logo * @get the data value of image from theme options * @display footer Image logo * * @uses default logo if logo field on theme options is empty * * @uses set_transient and delete_transient */ function simplecatch_footerlogo() { //delete_transient('simplecatch_footerlogo'); if ( !$simplecatch_footerlogo = get_transient( 'simplecatch_footerlogo' ) ) { global $simplecatch_options_settings; $options = $simplecatch_options_settings; echo ''; if ( empty( $options[ 'remove_footer_logo' ] ) ) : // if not empty featured_logo_footer on theme options if ( !empty( $options[ 'featured_logo_footer' ] ) ) : $simplecatch_footerlogo = ''.get_bloginfo( 'name' ).''; else: // if empty featured_logo_footer on theme options, display default Footer Logo $simplecatch_footerlogo =' footerlogo'; endif; endif; set_transient( 'simplecatch_footerlogo', $simplecatch_footerlogo, 86940 ); } echo $simplecatch_footerlogo; } endif; // simplecatch_footerlogo /** * Get the favicon Image from theme options * * @uses favicon * @get the data value of image from theme options * @display favicon * * @uses default favicon if favicon field on theme options is empty * * @uses set_transient and delete_transient */ function simplecatch_favicon() { //delete_transient( 'simplecatch_favicon' ); if( ( !$simplecatch_favicon = get_transient( 'simplecatch_favicon' ) ) ) { global $simplecatch_options_settings; $options = $simplecatch_options_settings; echo ''; // if not empty fav_icon on theme options if ( empty( $options[ 'remove_fav_icon' ] ) ) : // if not empty fav_icon on theme options if ( !empty( $options[ 'fav_icon' ] ) ) : $simplecatch_favicon = ''; else: // if empty featured_logo_footer on theme options, display default fav icon $simplecatch_favicon =''; endif; endif; set_transient( 'simplecatch_favicon', $simplecatch_favicon, 86940 ); } echo $simplecatch_favicon ; } // simplecatch_favicon //Load Favicon in Header Section add_action('wp_head', 'simplecatch_favicon'); //Load Favicon in Admin Section add_action( 'admin_head', 'simplecatch_favicon' ); if ( ! function_exists( 'simplecatch_sliders' ) ) : /** * This function to display featured posts on homepage header * * @get the data value from theme options * @displays on the homepage header * * @useage Featured Image, Title and Content of Post * * @uses set_transient and delete_transient */ function simplecatch_sliders() { global $post; //delete_transient( 'simplecatch_sliders' ); global $simplecatch_options_settings; $options = $simplecatch_options_settings; $postperpage = $options[ 'slider_qty' ]; if( ( !$simplecatch_sliders = get_transient( 'simplecatch_sliders' ) ) && !empty( $options[ 'featured_slider' ] ) ) { echo ''; $simplecatch_sliders = '
'; set_transient( 'simplecatch_sliders', $simplecatch_sliders, 86940 ); } echo $simplecatch_sliders; } endif; // simplecatch_sliders if ( ! function_exists( 'simplecatch_sliderbreadcrumb' ) ) : /** * Display slider or breadcrumb on header * * If the page is home or front page, slider is displayed. * In other pages, breadcrumb will display if exist bread */ function simplecatch_sliderbreadcrumb() { global $post, $wp_query; // Front page displays in Reading Settings $page_on_front = get_option('page_on_front') ; $page_for_posts = get_option('page_for_posts'); // Get Page ID outside Loop $page_id = $wp_query->get_queried_object_id(); // If the page is home or front page if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) : // This function passes the value of slider effect to js file if( function_exists( 'simplecatch_pass_slider_value' ) ) { simplecatch_pass_slider_value(); } // display featured slider if ( function_exists( 'simplecatch_sliders' ) ): simplecatch_sliders(); endif; else : // if breadcrumb is not empty, display breadcrumb if ( function_exists( 'bcn_display_list' ) ): echo ' '; endif; endif; } endif; // simplecatch_sliderbreadcrumb if ( ! function_exists( 'simplecatch_headersocialnetworks' ) ) : /** * This function for social links display on header * * @fetch links through Theme Options * @use in widget * @social links, Facebook, Twitter and RSS */ function simplecatch_headersocialnetworks() { //delete_transient( 'simplecatch_headersocialnetworks' ); global $simplecatch_options_settings; $options = $simplecatch_options_settings; $elements = array(); $elements = array( $options[ 'social_facebook' ], $options[ 'social_twitter' ], $options[ 'social_googleplus' ], $options[ 'social_linkedin' ], $options[ 'social_pinterest' ], $options[ 'social_youtube' ], $options[ 'social_vimeo' ], $options[ 'social_slideshare' ], $options[ 'social_foursquare' ], $options[ 'social_flickr' ], $options[ 'social_tumblr' ], $options[ 'social_deviantart' ], $options[ 'social_dribbble' ], $options[ 'social_myspace' ], $options[ 'social_wordpress' ], $options[ 'social_rss' ], $options[ 'social_delicious' ], $options[ 'social_lastfm' ], $options[ 'social_instagram' ], $options[ 'social_github' ], $options[ 'social_vkontakte' ], $options[ 'social_myworld' ], $options[ 'social_odnoklassniki' ], $options[ 'social_goodreads' ], $options[ 'social_skype' ], $options[ 'social_soundcloud' ] ); $flag = 0; if( !empty( $elements ) ) { foreach( $elements as $option) { if( !empty( $option ) ) { $flag = 1; } else { $flag = 0; } if( $flag == 1 ) { break; } } } if ( ( !$simplecatch_headersocialnetworks = get_transient( 'simplecatch_headersocialnetworks' ) ) && ( $flag == 1 ) ) { echo ''; $simplecatch_headersocialnetworks .='
'; set_transient( 'simplecatch_headersocialnetworks', $simplecatch_headersocialnetworks, 86940 ); } echo $simplecatch_headersocialnetworks; } endif; // simplecatch_headersocialnetworks /** * Site Verification and Webmaster Tools * * If user sets the code we're going to display meta verification * @get the data value from theme options * @uses wp_head action to add the code in the header * @uses set_transient and delete_transient API for cache */ function simplecatch_site_verification() { //delete_transient( 'simplecatch_site_verification' ); if ( ( !$simplecatch_site_verification = get_transient( 'simplecatch_site_verification' ) ) ) { global $simplecatch_options_settings; $options = $simplecatch_options_settings; echo ''; $simplecatch_site_verification = ''; //google if ( !empty( $options['google_verification'] ) ) { $simplecatch_site_verification .= '' . "\n"; } //bing if ( !empty( $options['bing_verification'] ) ) { $simplecatch_site_verification .= '' . "\n"; } //yahoo if ( !empty( $options['yahoo_verification'] ) ) { $simplecatch_site_verification .= '' . "\n"; } //site stats, analytics header code if ( !empty( $options['analytic_header'] ) ) { $simplecatch_site_verification .= $options[ 'analytic_header' ] ; } set_transient( 'simplecatch_site_verification', $simplecatch_site_verification, 86940 ); } echo $simplecatch_site_verification; } add_action('wp_head', 'simplecatch_site_verification'); /** * This function loads the Footer Code such as Add this code from the Theme Option * * @get the data value from theme options * @load on the footer ONLY * @uses wp_footer action to add the code in the footer * @uses set_transient and delete_transient */ function simplecatch_footercode() { //delete_transient( 'simplecatch_footercode' ); if ( ( !$simplecatch_footercode = get_transient( 'simplecatch_footercode' ) ) ) { global $simplecatch_options_settings; $options = $simplecatch_options_settings; echo ''; //site stats, analytics header code if ( !empty( $options['analytic_footer'] ) ) { $simplecatch_footercode = $options[ 'analytic_footer' ] ; } set_transient( 'simplecatch_footercode', $simplecatch_footercode, 86940 ); } echo $simplecatch_footercode; } add_action('wp_footer', 'simplecatch_footercode'); /** * Hooks the Custom Inline CSS to head section * * @since Simple Catch 1.2.3 */ function simplecatch_inline_css() { //delete_transient( 'simplecatch_inline_css' ); if ( ( !$simplecatch_inline_css = get_transient( 'simplecatch_inline_css' ) ) ) { global $simplecatch_options_settings, $simplecatch_options_defaults; $options = $simplecatch_options_settings; $defaults = $simplecatch_options_defaults; if( $options[ 'reset_color' ] == "0" || !empty( $options[ 'custom_css' ] ) ) { $simplecatch_inline_css = '' . "\n"; $simplecatch_inline_css .= '' . "\n"; } set_transient( 'simplecatch_inline_css', $simplecatch_inline_css, 86940 ); } echo $simplecatch_inline_css; } add_action('wp_head', 'simplecatch_inline_css'); /* * Function for showing custom tag cloud */ function simplecatch_custom_tag_cloud() { ?>
|
$transition_effect, 'transition_delay' => $transition_delay, 'transition_duration' => $transition_duration ) ); }// simplecatch_pass_slider_value /** * Alter the query for the main loop in home page * @uses pre_get_posts hook */ function simple_catch_alter_home( $query ){ global $simplecatch_options_settings; $options = $simplecatch_options_settings; $cats = $options[ 'front_page_category' ]; if ( $options[ 'exclude_slider_post'] != "0" && !empty( $options[ 'featured_slider' ] ) ) { if( $query->is_main_query() && $query->is_home() ) { $query->query_vars['post__not_in'] = $options[ 'featured_slider' ]; } } if ( !in_array( '0', (array) $cats ) ) { if( $query->is_main_query() && $query->is_home() ) { $query->query_vars['category__in'] = $options[ 'front_page_category' ]; } } } add_action( 'pre_get_posts','simple_catch_alter_home' ); /** * Add specific CSS class by filter * @uses body_class filter hook * @since Simple Catch 1.3.2 */ function simplecatch_class_names($classes) { global $post; if ( is_page_template( 'page-blog.php') ) { $classes[] = 'page-blog'; } if( $post ) { if ( is_attachment() ) { $parent = $post->post_parent; $layout = get_post_meta( $parent,'simplecatch-sidebarlayout', true ); } else { $layout = get_post_meta( $post->ID,'simplecatch-sidebarlayout', true ); } } if( empty( $layout ) || ( !is_page() && !is_single() ) ) { $layout='default'; } global $simplecatch_options_settings; $options = $simplecatch_options_settings; $themeoption_layout = $options['sidebar_layout']; if( ( $layout == 'no-sidebar' || ( $layout=='default' && $themeoption_layout == 'no-sidebar') ) ){ $classes[] = 'no-sidebar'; } return $classes; } add_filter('body_class','simplecatch_class_names'); if ( ! function_exists( 'simplecatch_content' ) ) : /** * Display the page/post content * @since Simple Catch 1.3.2 */ function simplecatch_content() { global $post; $layout = get_post_meta( $post->ID,'simplecatch-sidebarlayout', true ); if( empty( $layout ) ) $layout='default'; get_header(); if( $layout=='default') { global $simplecatch_options_settings; $options = $simplecatch_options_settings; $themeoption_layout = $options['sidebar_layout']; if( $themeoption_layout == 'left-sidebar' ) { get_template_part( 'content-sidebar','left' ); } elseif( $themeoption_layout == 'right-sidebar' ) { get_template_part( 'content-sidebar','right' ); } elseif( $themeoption_layout == 'no-sidebar-full-width' ) { get_template_part( 'content-sidebar','full' ); } else { get_template_part( 'content-sidebar','no' ); } } elseif( $layout=='left-sidebar' ) { get_template_part( 'content-sidebar','left' ); } elseif( $layout=='right-sidebar' ) { get_template_part( 'content-sidebar','right' ); } elseif( $layout == 'no-sidebar-full-width' ) { get_template_part( 'content-sidebar','full' ); } else{ get_template_part( 'content-sidebar','no' ); } get_footer(); } endif; // simplecatch_content if ( ! function_exists( 'simplecatch_loop' ) ) : /** * Display the page/post loop part * @since Simple Catch 1.3.2 */ function simplecatch_loop() { if( is_page() ): ?>
>

and paste at the post content where you want to break the page wp_link_pages(array( 'before' => '', 'link_before' => '', 'link_after' => '', 'pagelink' => '%', 'echo' => 1 ) ); ?>
>

and paste at the post content where you want to break the page wp_link_pages(array( 'before' => '', 'link_before' => '', 'link_after' => '', 'pagelink' => '%', 'echo' => 1 ) ); $tag = get_the_tags(); if (! $tag ) { ?>
Tags: ', ', ', '
'); } ?> '; global $simplecatch_options_settings; $options = $simplecatch_options_settings; $themeoption_layout = $options['sidebar_layout']; if( $themeoption_layout == 'left-sidebar' ) { get_sidebar(); echo '
'; } elseif( $themeoption_layout == 'right-sidebar' ) { echo '
'; } elseif( $themeoption_layout == 'no-sidebar-full-width' ) { echo '
'; } else { echo '
'; } return $themeoption_layout; } endif; // simplecatch_display_div /** * Redirect WordPress Feeds To FeedBurner */ function simplecatch_rss_redirect() { global $simplecatch_options_settings; $options = $simplecatch_options_settings; if ($options['feed_url']) { $url = 'Location: '.$options['feed_url']; if ( is_feed() && !preg_match('/feedburner|feedvalidator/i', $_SERVER['HTTP_USER_AGENT'])) { header($url); header('HTTP/1.1 302 Temporary Redirect'); } } } add_action('template_redirect', 'simplecatch_rss_redirect'); /** * Altering Comment Form Fields * @uses comment_form_default_fields filter */ function simplecatch_comment_form_fields( $fields ) { $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); $fields['author'] = ''; $fields['email'] = ''; $fields['url'] = ''; return $fields; } add_filter( 'comment_form_default_fields', 'simplecatch_comment_form_fields' ); /** * Altering Comment Form Defaults * * @uses comment_form_defaults filter */ function simplecatch_comment_form_defaults( $defaults ) { $defaults['comment_notes_before'] = ''; $defaults['comment_notes_after'] = ''; return $defaults; } add_filter( 'comment_form_defaults', 'simplecatch_comment_form_defaults' ); /** * Adds in post ID when viewing lists of posts * This will help the admin to add the post ID in featured slider * * @param mixed $post_columns * @return post columns */ function simplecatch_post_id_column( $post_columns ) { $beginning = array_slice( $post_columns, 0 ,1 ); $beginning[ 'postid' ] = __( 'ID', 'simplecatch' ); $ending = array_slice( $post_columns, 1 ); $post_columns = array_merge( $beginning, $ending ); return $post_columns; } add_filter( 'manage_posts_columns', 'simplecatch_post_id_column' ); function simplecatch_posts_id_column( $col, $val ) { if( $col == 'postid' ) echo $val; } add_action( 'manage_posts_custom_column', 'simplecatch_posts_id_column', 10, 2 ); function simplecatch_posts_id_column_css() { echo ''; } add_action( 'admin_head-edit.php', 'simplecatch_posts_id_column_css' ); /** * Get the Web Clip Icon from theme options * * @uses web clip * @get the data value of image from theme options * @display web clip * * @uses set_transient and delete_transient */ function simplecatch_webclip() { //delete_transient( 'simplecatch_webclip' ); if( ( !$simplecatch_webclip = get_transient( 'simplecatch_webclip' ) ) ) { global $simplecatch_options_settings; $options = $simplecatch_options_settings; echo ''; // if not empty fav_icon on theme options if ( !empty( $options[ 'web_clip' ] ) ) : $simplecatch_webclip = ''; endif; set_transient( 'simplecatch_webclip', $simplecatch_webclip, 86940 ); } echo $simplecatch_webclip ; } // simplecatch_webclip //Load Web Clip Icon in Header Section add_action('wp_head', 'simplecatch_webclip'); if ( !function_exists( 'simplecatch_infinite_scroll_render' ) ): /** * Set the code to be rendered on for calling posts, * hooked to template parts when possible. * * Note: must define a loop. */ function simplecatch_infinite_scroll_render() { get_template_part( 'content' ); } // simplecatch_infinite_scroll_render endif; if ( ! function_exists( 'simplecatch_content_nav' ) ) : /** * Display navigation to next/previous pages when applicable * * @since Catch Everest 1.0 */ function simplecatch_content_nav( $nav_id ) { global $wp_query, $post; /** * Check Jetpack Infinite Scroll * if it's active then disable pagination */ if ( class_exists( 'Jetpack', false ) ) { $jetpack_active_modules = get_option('jetpack_active_modules'); if ( $jetpack_active_modules && in_array( 'infinite-scroll', $jetpack_active_modules ) ) { return false; } } // Checking WP Page Numbers plugin exist if ( function_exists('wp_pagenavi' ) ) : wp_pagenavi(); // Checking WP-PageNaviplugin exist elseif ( function_exists('wp_page_numbers' ) ) : wp_page_numbers(); else: if ( $wp_query->max_num_pages > 1 ) : ?>