tag based on what is being viewed. * * @param string $title Default title text for current view. * @param string $sep Optional separator. * @return string The filtered title. */ function activello_wp_title( $title, $sep ) { if ( is_feed() ) { return $title; } global $page, $paged; // Add the blog name $title .= get_bloginfo( 'name', 'display' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) { $title .= " $sep $site_description"; } // Add a page number if necessary: if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { $title .= " $sep " . sprintf( esc_html__( 'Page %s', 'activello' ), max( $paged, $page ) ); } return $title; } add_filter( 'wp_title', 'activello_wp_title', 10, 2 ); /** * Title shim for sites older than WordPress 4.1. * * @link https://make.wordpress.org/core/2014/10/29/title-tags-in-4-1/ * @todo Remove this function when WordPress 4.3 is released. */ function activello_render_title() { ?> <?php wp_title( '|', true, 'right' ); ?> is_author() && isset( $wp_query->post ) ) { $GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author ); } } add_action( 'wp', 'activello_setup_author' ); /** * Password protected post form using Boostrap classes */ add_filter( 'the_password_form', 'custom_password_form' ); function custom_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '
' . esc_html__( "

This post is password protected. To view it please enter your password below:

" ,'activello') . '
'; return $o; } // Add Bootstrap classes for table add_filter( 'the_content', 'activello_add_custom_table_class' ); function activello_add_custom_table_class( $content ) { return str_replace( '', '
', $content ); } if ( ! function_exists( 'activello_header_menu' ) ) : /** * Header menu (should you choose to use one) */ function activello_header_menu() { // display the WordPress Custom Menu if available wp_nav_menu(array( 'menu' => 'primary', 'theme_location' => 'primary', 'depth' => 2, 'container' => 'div', 'container_class' => 'collapse navbar-collapse navbar-ex1-collapse', 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker() )); } /* end header menu */ endif; if ( ! function_exists( 'activello_footer_links' ) ) : /** * Footer menu (should you choose to use one) */ function activello_footer_links() { // display the WordPress Custom Menu if available wp_nav_menu(array( 'container' => '', // remove nav container 'container_class' => 'footer-links clearfix', // class of container (should you choose to use it) 'menu' => esc_html__( 'Footer Links', 'activello' ), // nav name 'menu_class' => 'nav footer-nav clearfix', // adding custom nav class 'theme_location' => 'footer-links', // where it's located in the theme 'before' => '', // before the menu 'after' => '', // after the menu 'link_before' => '', // before each link 'link_after' => '', // after each link 'depth' => 0, // limit the depth of the nav 'fallback_cb' => 'activello_footer_links_fallback' // fallback function )); } /* end activello footer link */ endif; if ( ! function_exists( 'activello_featured_slider' ) ) : /** * Featured image slider, displayed on front page for static page and blog */ function activello_featured_slider() { if ( is_front_page() && get_theme_mod( 'activello_featured_hide' ) == 1 ) { wp_enqueue_style( 'flexslider-css' ); wp_enqueue_script( 'flexslider-js' ); wp_enqueue_script( 'flexslider-customization' ); echo '
'; echo ''; echo '
'; } } endif; /** * function to show the footer info, copyright information */ function activello_footer_info() { global $activello_footer_info; printf( esc_html__( 'Theme by %1$s Powered by %2$s', 'activello' ) , 'Colorlib', 'WordPress'); } /** * Add Bootstrap thumbnail styling to images with captions * Use
and
* * @link http://justintadlock.com/archives/2011/07/01/captions-in-wordpress */ function activello_caption($output, $attr, $content) { if (is_feed()) { return $output; } $defaults = array( 'id' => '', 'align' => 'alignnone', 'width' => '', 'caption' => '' ); $attr = shortcode_atts($defaults, $attr); // If the width is less than 1 or there is no caption, return the content wrapped between the [caption] tags if ($attr['width'] < 1 || empty($attr['caption'])) { return $content; } // Set up the attributes for the caption
$attributes = (!empty($attr['id']) ? ' id="' . esc_attr($attr['id']) . '"' : '' ); $attributes .= ' class="thumbnail wp-caption ' . esc_attr($attr['align']) . '"'; $attributes .= ' style="width: ' . (esc_attr($attr['width']) + 10) . 'px"'; $output = ''; $output .= do_shortcode($content); $output .= '
' . $attr['caption'] . '
'; $output .= '
'; return $output; } add_filter('img_caption_shortcode', 'activello_caption', 10, 3); /** * Skype URI support for social media icons */ function activello_allow_skype_protocol( $protocols ){ $protocols[] = 'skype'; return $protocols; } add_filter( 'kses_allowed_protocols' , 'activello_allow_skype_protocol' ); /** * Add custom favicon displayed in WordPress dashboard and frontend */ function activello_add_favicon() { echo ''. "\n"; } add_action( 'wp_head', 'activello_add_favicon', 0 ); add_action( 'admin_head', 'activello_add_favicon', 0 ); /* * This one shows/hides the an option when a checkbox is clicked. */ add_action( 'optionsframework_custom_scripts', 'optionsframework_custom_scripts' ); function optionsframework_custom_scripts() { ?> $category ) { $cats[$category->term_id] = $category->name; } return $cats; } /** * Custom comment template */ function activello_cb_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
%s says:', 'activello' ), get_comment_author_link() ); ?> $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
comment_approved == '0' ) : ?>
'; if ( get_theme_mod('accent_color')) { echo 'a:hover, a:focus,article.post .post-categories a:hover, .entry-title a:hover, .entry-meta a:hover, .entry-footer a:hover, .read-more a:hover, .social-icons a:hover, .flex-caption .post-categories a:hover, .flex-caption .read-more a:hover, .flex-caption h2:hover, .comment-meta.commentmetadata a:hover, .post-inner-content .cat-item a:hover,.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, blockquote:before, .navbar-default .navbar-nav > .open > a:focus, .cat-title a, .single .entry-content a{color:' . get_theme_mod('accent_color') . '}'; echo 'article.post .post-categories:after, .post-inner-content .cat-item:after, #secondary .widget-title:after {background:' . get_theme_mod('accent_color') . '}'; echo '.btn-default:hover, .label-default[href]:hover, .label-default[href]:focus, .btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, #image-navigation .nav-previous a:hover, #image-navigation .nav-next a:hover, .woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .input-group-btn:last-child>.btn:hover, .scroll-to-top:hover, button, html input[type=button]:hover, input[type=reset]:hover, .comment-list li .comment-body:after, .page-links a:hover span, .page-links span, input[type=submit]:hover, .comment-form #submit:hover, .tagcloud a:hover, .single .entry-content a:hover{background-color:' . get_theme_mod('accent_color') . '; }'; } if ( get_theme_mod('social_color')) { echo '#social a, .header-search-icon { color:' . get_theme_mod('social_color') .'}'; } if ( get_theme_mod('social_hover_color')) { echo '#social a:hover, .header-search-icon:hover { color:' . get_theme_mod('social_hover_color') .'}'; } if ( get_theme_mod('custom_css')) { echo html_entity_decode( get_theme_mod( 'custom_css', 'no entry' ) ); } echo ''; } } add_action('wp_head','get_activello_theme_setting',10);