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() {
?>
', $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 '
';
$count = 4;
$slidecat = get_theme_mod( 'activello_featured_cat' );
$query = new WP_Query( array( 'cat' => $slidecat,'posts_per_page' => $count ) );
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
echo '