is_main_query() ) { return; } if ( is_search() ) { $query->set( 'posts_per_page', 20 ); } } add_action( 'pre_get_posts', 'basic_pre_get_posts' ); /* ========================================================================== */ /* ========================================================================== * customize excerpt text * ========================================================================== */ function basic_change_the_excerpt( $more ) { return ' ...'; } add_action( 'excerpt_more', 'basic_change_the_excerpt' ); /* ========================================================================== */ /* ========================================================================== * echo custom css * ========================================================================== */ function basic_print_custom_css_js() { $css = basic_get_theme_option( 'custom_styles' ); $js = basic_get_theme_option( 'head_scripts' ); if ( ! empty( $css ) ) { echo "\n\n"; } if ( ! empty( $js ) ) { echo "\n" . wp_specialchars_decode( $js, ENT_QUOTES ) . "\n"; } } add_action( 'wp_head', 'basic_print_custom_css_js', 20 ); /* ========================================================================== */ /* ========================================================================== * echo custom script in footer from options * ========================================================================== */ function basic_print_footer_js() { $footer_js = basic_get_theme_option( 'footer_scripts' ); if ( ! empty( $footer_js ) ) { echo "\n" . wp_specialchars_decode( $footer_js, ENT_QUOTES ) . "\n"; } } add_action( 'wp_footer', 'basic_print_footer_js' ); /* ========================================================================== */ /* ========================================================================== * add social button to the_content * ========================================================================== */ function basic_social_share_buttons( $content ) { $socbtn = basic_get_theme_option( 'social_share' ); $link_pages = wp_link_pages(); if ( ! is_singular() || empty( $socbtn ) || 'hide' == $socbtn ) { return $content . $link_pages; } $soc_title = basic_get_theme_option( 'title_before_socshare' ); $soc_html = "
"; $fitered_soc_html = apply_filters( 'basic_social_share', $soc_html ); return $content . $link_pages . $fitered_soc_html; } add_action( 'the_content', 'basic_social_share_buttons', 10 ); /* ========================================================================== */ /* ========================================================================== * * * ========================================================================== */ if ( ! function_exists( 'basic_the_content_entry' ) ) : function basic_the_content_entry( $content ) { return '