__( 'Primary Menu', 'quintus' ),
) );
/**
* Add support for Post Formats.
*/
add_theme_support( 'post-formats', array( 'aside', 'link', 'quote' ) );
}
endif; // quintus_setup
add_action( 'after_setup_theme', 'quintus_setup' );
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*/
function quintus_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'quintus_page_menu_args' );
/**
* Register widgetized area and update sidebar with default widgets.
*/
function quintus_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar 1', 'quintus' ),
'id' => 'sidebar-1',
'description' => __( 'This is Quintus\' widget sidebar. Leave empty if you want a one column layout.', 'quintus' ),
'before_widget' => '',
'before_title' => '
',
) );
}
add_action( 'widgets_init', 'quintus_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function quintus_scripts() {
wp_enqueue_style( 'quintus-style', get_stylesheet_uri() );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_style( 'lato', "https://fonts.googleapis.com/css?family=Lato:100,400,700&v2&subset=latin,latin-ext" );
}
add_action( 'wp_enqueue_scripts', 'quintus_scripts' );
/**
* Grab the first URL from a Link post
*/
function quintus_url_grabber() {
if ( ! preg_match( '/]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
return false;
return esc_url_raw( $matches[1] );
}
/**
* Add special classes to the WordPress body class.
*/
function quintus_body_classes( $classes ) {
// Add current color scheme class.
if ( 'archaic' == quintus_current_color_scheme() )
$classes[] = 'color-archaic';
else
$classes[] = 'color-default';
// If we have one sidebar active we have secondary content
if ( ! is_active_sidebar( 'sidebar-1' ) )
$classes[] = 'one-column';
return $classes;
}
add_filter( 'body_class', 'quintus_body_classes' );
/**
* Add some useful default widgets to the Quintus sidebar
*/
function quintus_default_widgets() {
$sidebars = get_option( 'sidebars_widgets' );
if ( empty ( $sidebars['sidebar-1'] ) && isset( $_GET['activated'] ) ) {
update_option( 'widget_links', array( 2 => array( 'title' => __( 'Blogs I Read', 'quintus' ) ), '_multiwidget' => 1 ) );
update_option( 'widget_categories', array( 2 => array( 'title' => __( 'Topics', 'quintus' ) ), '_multiwidget' => 1 ) );
update_option( 'widget_archives', array( 2 => array( 'title' => __( 'Archives', 'quintus' ) ), '_multiwidget' => 1 ) );
update_option( 'sidebars_widgets', array(
'wp_inactive_widgets' => array(),
'sidebar-1' => array(
0 => 'links-2',
1 => 'categories-2',
2 => 'archives-2',
),
'array_version' => 3
) );
}
}
add_action( 'after_setup_theme', 'quintus_default_widgets' );
/**
* Allow a solid background color.
*/
function quintus_solid_background_color() {
if ( get_background_image() == '' && get_background_color() != '' ) { ?>
'default',
);
$options = get_option( 'quintus_theme_options', $defaults );
return $options;
}
/**
* Returns the current Quintus color scheme as selected in the theme options.
*/
function quintus_current_color_scheme() {
$options = quintus_get_theme_options();
return $options['color_scheme'];
}
/**
* Register our color scheme and add them to the queue.
*/
function quintus_color_registrar() {
$color_scheme = quintus_current_color_scheme();
if ( 'default' == $color_scheme )
return;
wp_enqueue_style( $color_scheme, get_template_directory_uri() . '/colors/' . $color_scheme . '.css', null, null );
}
add_action( 'wp_enqueue_scripts', 'quintus_color_registrar' );
/**
* Adjust the content_width value based on current template.
*
*/
function quintus_set_full_content_width() {
global $content_width;
$content_width = 940;
}
/**
* Filters wp_title to print a neat tag based on what is being viewed.
*
* @since Quintus 1.1
*/
function quintus_wp_title( $title, $sep ) {
global $page, $paged;
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 .= " $sep $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
$title .= " $sep " . sprintf( __( 'Page %s', 'quintus' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'quintus_wp_title', 10, 2 );
/**
* Custom Theme Options
*/
require get_template_directory() . '/inc/theme-options.php';
/**
* Implement the Custom Header feature
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* This theme was built with PHP, Semantic HTML, CSS, love, and a Toolbox.
*/