'
) );
register_sidebar( array(
'name' => esc_html__( 'First Front Page Banner Widget', 'responsivo' ),
'id' => 'frontpage-banner1',
'description' => esc_html__( 'Appears in the banner area on the Front Page', 'responsivo' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
'
) );
register_sidebar( array(
'name' => esc_html__( 'Second Front Page Banner Widget', 'responsivo' ),
'id' => 'frontpage-banner2',
'description' => esc_html__( 'Appears in the banner area on the Front Page', 'responsivo' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
'
) );
register_sidebar( array(
'name' => esc_html__( 'First Front Page Widget Area', 'responsivo' ),
'id' => 'sidebar-homepage1',
'description' => esc_html__( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'responsivo' ),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
register_sidebar( array(
'name' => esc_html__( 'Second Front Page Widget Area', 'responsivo' ),
'id' => 'sidebar-homepage2',
'description' => esc_html__( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'responsivo' ),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
register_sidebar( array(
'name' => esc_html__( 'Third Front Page Widget Area', 'responsivo' ),
'id' => 'sidebar-homepage3',
'description' => esc_html__( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'responsivo' ),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
register_sidebar( array(
'name' => esc_html__( 'Fourth Front Page Widget Area', 'responsivo' ),
'id' => 'sidebar-homepage4',
'description' => esc_html__( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'responsivo' ),
'before_widget' => '',
'before_title' => '
'
) );
}
add_action( 'widgets_init', 'responsivo_widgets_init' );
/**
* Enqueue scripts and styles
*
* @since Responsivo 1.0
*
* @return void
*/
function responsivo_scripts_styles() {
/**
* Register and enqueue our stylesheets
*/
// Start off with a clean base by using normalise. If you prefer to use a reset stylesheet or something else, simply replace this
wp_register_style( 'normalize', trailingslashit( get_template_directory_uri() ) . 'css/normalize.css' , array(), '3.0.1', 'all' );
wp_enqueue_style( 'normalize' );
// Register and enqueue our icon font
// We're using the awesome Font Awesome icon font. http://fortawesome.github.io/Font-Awesome
wp_register_style( 'fontawesome', trailingslashit( get_template_directory_uri() ) . 'css/font-awesome.min.css' , array(), '4.2.0', 'all' );
wp_enqueue_style( 'fontawesome' );
// Our styles for setting up the grid.
// If you prefer to use a different grid system, simply replace this and perform a find/replace in the php for the relevant styles. I'm nice like that!
wp_register_style( 'responsivo_gridsystem', trailingslashit( get_template_directory_uri() ) . 'css/grid.css' , array(), '1.0.0', 'all' );
wp_enqueue_style( 'responsivo_gridsystem' );
/*
* Load our Google Fonts.
*
* To disable in a child theme, use wp_dequeue_style()
* function mytheme_dequeue_fonts() {
* wp_dequeue_style( 'responsivo-fonts' );
* }
* add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
*/
$fonts_url = responsivo_fonts_url();
if ( !empty( $fonts_url ) ) {
wp_enqueue_style( 'responsivo-fonts', esc_url_raw( $fonts_url ), array(), null );
}
// Enqueue the default WordPress stylesheet
wp_enqueue_style( 'style', get_stylesheet_uri(), array(), '1.2.3', 'all' );
/**
* Register and enqueue our scripts
*/
// Load Modernizr at the top of the document, which enables HTML5 elements and feature detects
wp_register_script( 'modernizr', trailingslashit( get_template_directory_uri() ) . 'js/modernizr-2.8.2-min.js', array(), '2.8.2', false );
wp_enqueue_script( 'modernizr' );
// Adds JavaScript to pages with the comment form to support sites with threaded comments (when in use)
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
// Load jQuery Validation as well as the initialiser to provide client side comment form validation
// Using the 1.11.0pre version as it fixes an error that causes the email validation to fire immediately when text is entered in the field
// You can change the validation error messages below
if ( is_singular() && comments_open() ) {
wp_register_script( 'validate', trailingslashit( get_template_directory_uri() ) . 'js/jquery.validate.min.1.11.0pre.js', array( 'jquery' ), '1.11.0', true );
wp_register_script( 'commentvalidate', trailingslashit( get_template_directory_uri() ) . 'js/comment-form-validation.js', array( 'jquery', 'validate' ), '1.11.0', true );
wp_enqueue_script( 'commentvalidate' );
wp_localize_script( 'commentvalidate', 'comments_object', array(
'req' => get_option( 'require_name_email' ),
'author' => esc_html__( 'Please enter your name', 'responsivo' ),
'email' => esc_html__( 'Please enter a valid email address', 'responsivo' ),
'comment' => esc_html__( 'Please add a comment', 'responsivo' ) )
);
}
// Include this script to envoke a button toggle for the main navigation menu on small screens
//wp_register_script( 'small-menu', trailingslashit( get_template_directory_uri() ) . 'js/small-menu.js', array( 'jquery' ), '20130130', true );
//wp_enqueue_script( 'small-menu' );
}
add_action( 'wp_enqueue_scripts', 'responsivo_scripts_styles' );
/**
* Creates a nicely formatted and more specific title element text
* for output in head of document, based on current view.
*
* @since Responsivo 1.0
*
* @param string $title Default title text for current view.
* @param string $sep Optional separator.
* @return string The filtered title.
*/
function responsivo_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() ) {
return $title;
}
// Add the blog name.
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) ) {
$title = "$title $sep $site_description";
}
// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 ) {
$title = "$title $sep " . sprintf( esc_html__( 'Page %s', 'responsivo' ), max( $paged, $page ) );
}
return $title;
}
add_filter( 'wp_title', 'responsivo_wp_title', 10, 2 );
/**
* Displays navigation to next/previous pages when applicable.
*
* @since Responsivo 1.0
*
* @param string html ID
* @return void
*/
if ( ! function_exists( 'responsivo_content_nav' ) ) {
function responsivo_content_nav( $nav_id ) {
global $wp_query;
$big = 999999999; // need an unlikely integer
$nav_class = 'site-navigation paging-navigation';
if ( is_single() ) {
$nav_class = 'site-navigation post-navigation nav-single';
}
?>
. WordPress will add it itself once it's done listing any children and whatnot)
*
* @since Responsivo 1.0
*
* @param array Comment
* @param array Arguments
* @param integer Comment depth
* @return void
*/
if ( ! function_exists( 'responsivo_comment' ) ) {
function responsivo_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) {
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments ?>
id="comment-">
', '' ); ?>
id="li-comment-">
%1$s %2$s',
get_comment_author_link(),
// If current post author is also comment author, make it known visually.
( $comment->user_id === $post->post_author ) ? ' ' . esc_html__( 'Post author', 'responsivo' ) . '' : '' );
printf( '',
esc_url( get_comment_link( $comment->comment_ID ) ),
sprintf( esc_html__( '%1$s @ %2$s', 'responsivo' ), esc_html( get_comment_date() ), esc_attr( get_comment_time() ) ),
get_comment_time( 'c' ),
/* Translators: 1: date, 2: time */
sprintf( esc_html__( '%1$s at %2$s', 'responsivo' ), get_comment_date(), get_comment_time() )
);
?>
comment_approved ) { ?>
', '' ); ?>
';
return $fields;
}
add_action( 'comment_form_default_fields', 'responsivo_comment_form_default_fields' );
/**
* Update the Comments form to add a 'required' span to the Comment textarea within the form label, because it's pointless
* submitting a comment that doesn't actually have any text in the comment field!
*
* @since Responsivo 1.0
*
* @param string Comment form textarea html
* @return string The updated comment form textarea html
*/
function responsivo_comment_form_field_comment( $field ) {
$field = '';
return $field;
}
add_action( 'comment_form_field_comment', 'responsivo_comment_form_field_comment' );
/**
* Prints HTML with meta information for current post: author and date
*
* @since Responsivo 1.0
*
* @return void
*/
if ( ! function_exists( 'responsivo_posted_on' ) ) {
function responsivo_posted_on() {
$post_icon = '';
switch ( get_post_format() ) {
case 'aside':
$post_icon = 'fa-file-o';
break;
case 'audio':
$post_icon = 'fa-volume-up';
break;
case 'chat':
$post_icon = 'fa-comment';
break;
case 'gallery':
$post_icon = 'fa-camera';
break;
case 'image':
$post_icon = 'fa-picture-o';
break;
case 'link':
$post_icon = 'fa-link';
break;
case 'quote':
$post_icon = 'fa-quote-left';
break;
case 'status':
$post_icon = 'fa-user';
break;
case 'video':
$post_icon = 'fa-video-camera';
break;
default:
$post_icon = 'fa-calendar';
break;
}
// Translators: 1: Icon 2: Permalink 3: Post date and time 4: Publish date in ISO format 5: Post date
$date = sprintf( ' ',
$post_icon,
esc_url( get_permalink() ),
sprintf( esc_html__( '%1$s @ %2$s', 'responsivo' ), esc_html( get_the_date() ), esc_attr( get_the_time() ) ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
// Translators: 1: Date link 2: Author link 3: Categories 4: No. of Comments
$author = sprintf( ' %3$s',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( esc_html__( 'View all posts by %s', 'responsivo' ), get_the_author() ) ),
get_the_author()
);
// Return the Categories as a list
$categories_list = get_the_category_list( esc_html__( ' ', 'responsivo' ) );
// Translators: 1: Permalink 2: Title 3: No. of Comments
$comments = sprintf( '%2$s',
esc_url( get_comments_link() ),
( get_comments_number() > 0 ? sprintf( _n( '%1$s Comment', '%1$s Comments', get_comments_number(), 'responsivo' ), get_comments_number() ) : esc_html__( 'No Comments', 'responsivo' ) )
);
// Translators: 1: Date 2: Author 3: Categories 4: Comments
printf( wp_kses( __( '
%1$s%2$s%3$s%4$s
', 'responsivo' ), array(
'div' => array (
'class' => array() ),
'span' => array(
'class' => array() ) ) ),
$date,
$author,
$categories_list,
( is_search() ? '' : $comments )
);
}
}
/**
* Prints HTML with meta information for current post: categories, tags, permalink
*
* @since Responsivo 1.0
*
* @return void
*/
if ( ! function_exists( 'responsivo_entry_meta' ) ) {
function responsivo_entry_meta() {
// Return the Tags as a list
$tag_list = "";
if ( get_the_tag_list() ) {
$tag_list = get_the_tag_list( '', esc_html__( ' ', 'responsivo' ), '' );
}
// Translators: 1 is tag
if ( $tag_list ) {
printf( wp_kses( __( ' %1$s', 'responsivo' ), array( 'i' => array( 'class' => array() ) ) ), $tag_list );
}
}
}
/**
* Adjusts content_width value for full-width templates and attachments
*
* @since Responsivo 1.0
*
* @return void
*/
function responsivo_content_width() {
if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() ) {
global $content_width;
$content_width = 1200;
}
}
add_action( 'template_redirect', 'responsivo_content_width' );
/**
* Change the "read more..." link so it links to the top of the page rather than part way down
*
* @since Responsivo 1.0
*
* @param string The 'Read more' link
* @return string The link to the post url without the more tag appended on the end
*/
function responsivo_remove_more_jump_link( $link ) {
$offset = strpos( $link, '#more-' );
if ( $offset ) {
$end = strpos( $link, '"', $offset );
}
if ( $end ) {
$link = substr_replace( $link, '', $offset, $end-$offset );
}
return $link;
}
add_filter( 'the_content_more_link', 'responsivo_remove_more_jump_link' );
/**
* Returns a "Continue Reading" link for excerpts
*
* @since Responsivo 1.0
*
* @return string The 'Continue reading' link
*/
function responsivo_continue_reading_link() {
return '…