__( 'Primary Menu', 'good' ),
'secondary' => __( 'Secondary Menu', 'good' ),
'footer' => __( 'Footer Menu', 'good' ),
) );
/**
* Enable support for Post Formats
*/
add_theme_support( 'post-formats', array( 'video' ) );
}
endif; // good-by-fancythemes_setup
add_action( 'after_setup_theme', 'fancythemes_setup' );
/**
* Setup the WordPress core custom background feature.
*
* Use add_theme_support to register support for WordPress 3.4+
* as well as provide backward compatibility for WordPress 3.3
* using feature detection of wp_get_theme() which was introduced
* in WordPress 3.4.
*
* @todo Remove the 3.3 support when WordPress 3.6 is released.
*
* Hooks into the after_setup_theme action.
*/
function fancythemes_register_custom_background() {
$args = array(
'default-color' => 'eeeeee',
'default-image' => '',//get_template_directory_uri() . '/img/background-pattern.png',
);
$args = apply_filters( 'fancythemes_custom_background_args', $args );
if ( function_exists( 'wp_get_theme' ) ) {
add_theme_support( 'custom-background', $args );
} else {
define( 'BACKGROUND_COLOR', $args['default-color'] );
if ( ! empty( $args['default-image'] ) )
define( 'BACKGROUND_IMAGE', $args['default-image'] );
add_theme_support('custom-background',$args['default-image']);
}
}
add_action( 'after_setup_theme', 'fancythemes_register_custom_background' );
/**
* Register widgetized area and update sidebar with default widgets
*
* @since fancythemes 1.0
*/
function fancythemes_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'good' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
'widget_id' =>'%1$s',
'widget_position' => 'sidebar',
) );
register_sidebar( array(
'name' => __( 'Header Ad', 'good' ),
'id' => 'header-ad',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'widget_id' =>'%1$s',
'widget_position' => 'main-content',
) );
$page_args = array( 'post_type' => 'page',
'meta_key' => '_wp_page_template',
'meta_value' => 'widgetized-page.php',
);
$list_pages = get_posts($page_args);
//print_r($list_pages);
foreach( $list_pages as $w_page ){
register_sidebar( array(
'name' => $w_page->post_title,
'id' => $w_page->post_name,
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'widget_id' =>'%1$s',
) );
}
}
add_action( 'widgets_init', 'fancythemes_widgets_init' );
/**
* Enqueue scripts and styles
*/
function fancythemes_scripts() {
wp_enqueue_style( 'style', get_stylesheet_uri() );
wp_enqueue_script('jquery');
wp_enqueue_script( 'good', get_template_directory_uri() . '/js/good.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'imagesloaded', get_template_directory_uri() . '/js/jquery.imagesloaded.min.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', array( 'jquery' ), '20120206', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
if ( is_singular() && wp_attachment_is_image() ) {
wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
}
}
add_action( 'wp_enqueue_scripts', 'fancythemes_scripts', 20 );
/**
* Implement the Custom Header feature
*/
//require( get_template_directory() . '/inc/custom-header.php' );
/**
* Get theme option set by customizer
*/
function fancythemes_get_option($optname){
return get_theme_mod($optname);
}
/************* COMMENT LAYOUT *********************/
// Comment Layout
function fancythemes_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
>