__( 'Header Menu', 'biscayalite' ),
'footer' => __( 'Footer Menu', 'biscayalite' ),
) );
}
endif;
add_action( 'after_setup_theme', 'wow_setup' );
/*********************************************************************************************
SUPPORT THUMBNAILS
*********************************************************************************************/
add_theme_support( 'post-thumbnails' );
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 9999, 9999 ); // default Post Thumbnail dimensions
}
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'category-thumb', 300, 9999 ); //300 pixels wide (and unlimited height)
add_image_size( 'blogindex-thumb', 600, 350, true ); //(cropped)
add_image_size( 'sticky-thumb', 230, 150, true ); //(cropped)
}
/*********************************************************************************************
EXCERPTS
*********************************************************************************************/
function wow_get_custom_excerpt($count){
global $post;
$permalink = get_permalink($post->ID);
$excerpt = get_the_content();
$excerpt = strip_shortcodes($excerpt);
$excerpt = strip_tags($excerpt);
$excerpt = substr($excerpt, 0, $count);
$excerpt = substr($excerpt, 0, strripos($excerpt, " "));
return $excerpt;
}
/*********************************************************************************************
PAGINATION
*********************************************************************************************/
function wow_pagination($pages = '', $range = 2)
{
$showitems = ($range * 2)+1;
global $paged;
if(empty($paged)) $paged = 1;
if($pages == '')
{
global $wp_query;
$pages = $wp_query->max_num_pages;
if(!$pages)
{
$pages = 1;
}
}
if(1 != $pages)
{
echo "
\n";
}
}
/*********************************************************************************************
NAVIGATION LINKS
*********************************************************************************************/
if ( ! function_exists( 'wow_content_nav' ) ) :
/**
* Display navigation to next/previous pages when applicable
*/
function wow_content_nav( $nav_id ) {
global $wp_query, $post;
// Don't print empty markup on single pages if there's nowhere to navigate.
if ( is_single() ) {
$previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous )
return;
}
// Don't print empty markup in archives if there's only one page.
if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) )
return;
$nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation';
?>
1,
) );
// Count the number of categories that are attached to the posts
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'all_the_cool_cats', $all_the_cool_cats );
}
if ( '1' != $all_the_cool_cats ) {
// This blog has more than 1 category so wow_categorized_blog should return true
return true;
} else {
// This blog has only 1 category so wow_categorized_blog should return false
return false;
}
}
/*********************************************************************************************
REGISTER WIDGETIZED AREAS
*********************************************************************************************/
function wow_widgets_init() {
register_sidebar( array(
'name' => __( 'Blog Sidebar', 'biscayalite' ),
'id' => 'sidebar-1',
'before_widget' => '',
) );
register_sidebar( array(
'name' => __( 'Pages Sidebar', 'biscayalite' ),
'id' => 'sidebar-2',
'before_widget' => '',
) );
register_sidebar( array(
'name' => __( 'Footer Widgets', 'biscayalite' ),
'id' => 'footerwidgets',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'wow_widgets_init' );
/*********************************************************************************************
COMMENTS
*********************************************************************************************/
if ( ! function_exists( 'wow_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*/
function wow_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>
add_section( 'wow_logo_section' ,
array(
'title' => __( 'Logo', 'biscayalite' ),
'priority' => 30,
'description' => __( 'Upload a logo for this theme', 'biscayalite'),
));
$wp_customize->add_setting( 'wow_logo' ,
array (
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'wow_logo',
array(
'label' => __( 'Current logo', 'biscayalite' ),
'section' => 'wow_logo_section',
'settings' => 'wow_logo',
)));
/*footer*/
$wp_customize->add_section('wow_copyright_section',
array(
'title' => __( 'Footer Copyright', 'biscayalite' ),
'description' => __( ' BISCAYA PRO is now built with best front end drag & drop page builder - Elementor. Click for live demo!', 'biscayalite'),
'priority' => 35,
));
$wp_customize->add_setting('wow_copyright',
array(
'sanitize_callback' => 'wow_sanitize_text',
));
$wp_customize->add_control('wow_copyright',
array(
'label' => __( 'Copyright text', 'biscayalite' ),
'section' => 'wow_copyright_section',
'type' => 'textarea',
));
}
add_action('customize_register', 'wow_customize_register');
function wow_sanitize_text( $input ) {
return wp_kses_post( force_balance_tags( $input ) );
}
//-----------------------------------------------------
// Add Google Font
//-----------------------------------------------------
function biscayalite_fonts() {
wp_register_style('biscayalite-googleFonts', 'https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,700,300');
wp_enqueue_style( 'biscayalite-googleFonts');
}
add_action( 'wp_enqueue_scripts', 'biscayalite_fonts' );
/*********************************************************************************************
REQUIRES
*********************************************************************************************/
require_once( get_template_directory() . '/inc/nav.php');
/*********************************************************************************************
WOO COMMERCE SUPPORT
*********************************************************************************************/
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
add_theme_support( 'woocommerce' );
}