'f7f3ed',
'border' => 'd1bfa6',
'text' => '121212',
'link' => 'cc4d22',
'url' => '07818c',
);
/**
* Set the content width based on the theme's design and stylesheet.
*
* Used to set the width of images and content. Should be equal to the width the theme
* is designed for, generally via the style.css stylesheet.
*/
if ( ! isset( $content_width ) )
$content_width = 610;
/**
* Load the Theme Options Page that lets users control the social media icons at the top
*/
require_once ( get_template_directory() . '/inc/theme-options.php' );
/**
* Tell WordPress to run liquorice_setup() when the 'after_setup_theme' hook is run.
*/
add_action( 'after_setup_theme', 'liquorice_setup' );
if ( ! function_exists( 'liquorice_setup' ) ):
function liquorice_setup() {
// This theme uses post thumbnails.
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 150, 150 );
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// This theme supports post formats.
add_theme_support( 'post-formats', array( 'aside', 'image', 'quote', 'gallery' ) );
// Make theme available for translation
// Translations can be filed in the /languages/ directory
load_theme_textdomain( 'liquorice', get_template_directory() . '/languages' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'liquorice' ),
) );
// This theme allows users to set a custom background.
add_theme_support( 'custom-background' );
// Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
function liquorice_page_menu_args($args) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'liquorice_page_menu_args' );
add_theme_support( 'print-style' );
}
endif;
function liquorice_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'liquorice_custom_header_args', array(
'default-image' => '',
'default-text-color' => 'cc4d22',
'width' => 900,
'height' => 235,
'wp-head-callback' => 'liquorice_header_style',
'admin-head-callback' => 'liquorice_admin_header_style',
) ) );
}
add_action( 'after_setup_theme', 'liquorice_custom_header_setup' );
/**
* Enqueue scripts and styles
*/
function liquorice_scripts() {
wp_enqueue_style( 'liquorice', get_stylesheet_uri() );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'liquorice_scripts' );
if ( ! function_exists( 'liquorice_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
*/
function liquorice_header_style() {
// If no custom options for text are set, let's bail
if ( HEADER_TEXTCOLOR == get_header_textcolor() && '' == get_header_image() )
return;
// If we get this far, we have custom styles. Let's do this.
?>
Header admin panel.
*
*/
function liquorice_admin_header_style() {
?>
__( 'Sidebar', 'liquorice' ),
'id' => 'primary',
'before_widget' => '
',
'after_widget' => "",
'before_title' => '',
) );
}
add_action( 'init', 'liquorice_widgets_init' );
/**
* Removes the default styles that are packaged with the Recent Comments widget.
*/
function liquorice_remove_recent_comments_style() {
global $wp_widget_factory;
if ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) {
remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
}
}
add_action( 'widgets_init', 'liquorice_remove_recent_comments_style' );
if ( ! function_exists( 'liquorice_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post's date/time and author.
*/
function liquorice_posted_on() {
// use the "byline" class to hide the author name and link.
printf( __( 'Posted on %2$s by %3$s', 'liquorice' ),
'meta-prep meta-prep-author',
sprintf( '%3$s',
get_permalink(),
esc_attr( get_the_time() ),
get_the_date()
),
sprintf( '%3$s',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'liquorice' ), get_the_author() ) ),
get_the_author()
),
'byline'
);
}
endif;
if ( ! function_exists( 'liquorice_posted_in' ) ) :
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*/
function liquorice_posted_in() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list && ! is_wp_error( $tag_list ) ) {
$posted_in = __( 'Posted in %1$s and tagged %2$s. Bookmark the permalink.', 'liquorice' );
} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
$posted_in = __( 'Posted in %1$s. Bookmark the permalink.', 'liquorice' );
} else {
$posted_in = __( 'Bookmark the permalink.', 'liquorice' );
}
// Prints the string, replacing the placeholders.
printf(
$posted_in,
get_the_category_list( ', ' ),
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
}
endif;
if ( ! function_exists( 'liquorice_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own liquorice_comment(), and that function will be used instead.
*
*/
function liquorice_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
?>
id="li-comment-">
tag based on what is being viewed.
*
* @since Liquorice 2.1
*/
function liquorice_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', 'liquorice' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'liquorice_wp_title', 10, 2 );