tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
//add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'lawyer' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',
) );
/*
* Enable support for Post Formats.
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'quote', 'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'lawyer_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
endif; // lawyer_setup
add_action( 'after_setup_theme', 'lawyer_setup' );
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function lawyer_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'lawyer' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer Left', 'lawyer' ),
'id' => 'footer-1',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer Center', 'lawyer' ),
'id' => 'footer-2',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'lawyer_widgets_init' );
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
wp_enqueue_script('jquery');
}
/**
* Enqueue scripts and styles.
*/
function lawyer_scripts() {
wp_enqueue_style( 'lawyer-style', get_stylesheet_uri() );
wp_enqueue_script( 'lawyer-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'lawyer-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
wp_enqueue_script( 'lawyer-materialize', get_template_directory_uri() . '/js/materialize.min.js', array(), '2', true );
wp_enqueue_script( 'lawyer-customizer', get_template_directory_uri() . '/js/custom.js', array(), '2', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'lawyer_scripts' );
/**
* Implement the Custom Header feature.
*/
//require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
function home_top_init() {
register_sidebar( array(
'name' => 'Home Top',
'id' => 'home-top',
'before_widget' => '',
'after_widget' => '
'
) );
}
add_action( 'widgets_init', 'home_top_init' );
$theme = 'Optiqal Lawyer 1';
function create_setting($wp_customize, $setting_name, $setting_default, $setting_type, $title, $section, $priority) {
$wp_customize->add_setting( $setting_name , array(
'default' => $setting_default,
'transport' => 'refresh',
'sanitize_callback' => 'esc_url_raw'
) );
if ($setting_type === 'color') {
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $setting_name, array(
'label' => __( $title, $theme ),
'section' => $section,
'settings' => $setting_name,
'priority' => $priority,
) ) );
} elseif ($setting_type == 'text') {
$wp_customize->add_control(
$setting_name,
array(
'label' => __( $title, $theme ),
'section' => $section,
'settings' => $setting_name,
'priority' => $priority,
)
);
} elseif ($setting_type === 'image') {
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
$setting_name,
array(
'label' => __( $title, $theme ),
'section' => $section,
'settings' => $setting_name,
'priority' => $priority,
'default',
)
)
);
} elseif ($setting_type === 'fonts') {
$wp_customize->add_control(
new Google_Font_Dropdown_Custom_Control(
$wp_customize,
$setting_name,
array(
'label' => __( $title, $theme ),
'section' => $section,
'settings' => $setting_name,
'priority' => $priority
)
)
);
}
}
function mytheme_customize_register( $wp_customize ) {
$wp_customize->add_section( 'header' , array(
'title' => __( 'Header', $theme ),
'priority' => 5,
) );
$wp_customize->add_section( 'footer' , array(
'title' => __( 'Footer', $theme ),
'priority' => 8,
) );
$wp_customize->add_section( 'home_page' , array(
'title' => __( 'Home Page', $theme ),
'priority' => 6,
) );
$wp_customize->add_section( 'colors' , array(
'title' => __( 'Colors', $theme ),
'priority' => 7,
) );
$wp_customize->add_section( 'not_found' , array(
'title' => __( 'Not Found Page', $theme ),
'priority' => 30,
) );
create_setting($wp_customize, 'paragraph_color', "#000000", "color", "Paragraph Color", "colors", 1);
create_setting($wp_customize, 'link_color', "#42A5F5", "color", "Link Color", "colors", 2);
create_setting($wp_customize, 'navigation_color', "#000000", "color", "Navigation Color", "colors", 3);
create_setting($wp_customize, 'button_color', "#42A5F5", "color", "Button Color", "colors", 4);
create_setting($wp_customize, 'sub_navigation_color', "#FFFFFF", "color", "Dropdown Menu Color", "colors", 5);
create_setting($wp_customize, 'flyout_bg', "#FFFFFF", "color", "Flyout Menu Background Color", "colors", 6);
create_setting($wp_customize, 'flyout_a', "#000000", "color", "Flyout Menu Text Color", "colors", 7);
create_setting($wp_customize, 'sec_ban_color', "#42A5F5", "color", "Secondary Banner Color", "colors", 8);
create_setting($wp_customize, 'sec_ban_link_color', "#FFFFFF", "color", "Secondary Banner Link Color", "colors", 9);
create_setting($wp_customize, 'sec_ban_hdr_color', "#FFFFFF", "color", "Secondary Banner Header Color", "colors", 10);
create_setting($wp_customize, 'sec_ban_p_color', "#FFFFFF", "color", "Secondary Banner Paragraph Color", "colors", 11);
create_setting($wp_customize, 'banner_hdr_color', "#FFFFFF", "color", "Banner Header Color", "colors", 12);
create_setting($wp_customize, 'banner_p_color', "#CCCCCC", "color", "Banner Text Color", "colors", 13);
create_setting($wp_customize, 'banner_cont_color', "#FFFFFF", "color", "Banner 'Contact Us' Header Color", "colors", 14);
create_setting($wp_customize, 'footer_titles', "#FFFFFF", "color", "Footer Widget Title Color", "colors", 15);
create_setting($wp_customize, 'footer_content', "#CCCCCC", "color", "Footer Widget Content Color", "colors", 16);
create_setting($wp_customize, 'logo_img', get_template_directory_uri() . "/images/logo.png", "image", "Logo File", "header", 1);
create_setting($wp_customize, 'call_us_text', "Call Us Today", "text", "Call Us Text", "header", 2);
create_setting($wp_customize, 'call_us_number', "+1-888-555-5555", "text", "Call Us Number", "header", 3);
create_setting($wp_customize, 'banner_header', "Avocat", "text", "Banner Header", "home_page", 2);
create_setting($wp_customize, 'banner_text', "Avocat is a unique wordpress theme designed for small to mid-size lawfirms and offers a turnkey solution to your needs.", "textarea", "Banner Text", "home_page", 3);
create_setting($wp_customize, 'subbanner_text', "Avocat is easy to use", "text", "Sub-banner Header", "home_page", 4);
create_setting($wp_customize, 'box1_hdr', "Design", "text", "Home Box 1 Title", "home_page", 5);
create_setting($wp_customize, 'box1_img', get_template_directory_uri() . "/images/box1.png", "image", "Home Box 1 Image", "home_page", 6);
create_setting($wp_customize, 'box1_text', "Based on Materialize, Avocat uses bleeding edge design element and typography.", "text", "Home Box 1 Text", "home_page", 7);
create_setting($wp_customize, 'box2_hdr', "Responsive", "text", "Home Box 2 Title", "home_page", 8);
create_setting($wp_customize, 'box2_img', get_template_directory_uri() . "/images/box2.png", "image", "Home Box 2 Image", "home_page", 9);
create_setting($wp_customize, 'box2_text', "Avocat works on all devices, all the time. We handled all of the responsive hurdles for you.", "text", "Home Box 2 Text", "home_page", 10);
create_setting($wp_customize, 'box3_hdr', "Support", "text", "Home Box 3 Title", "home_page", 11);
create_setting($wp_customize, 'box3_img', get_template_directory_uri() . "/images/box3.png", "image", "Home Box 3 Image", "home_page", 12);
create_setting($wp_customize, 'box3_text', "Find something wrong with Avocat? Contact us and tell us what we need to fix.", "text", "Home Box 3 Text", "home_page", 13);
create_setting($wp_customize, 'about_us_hdr', "About Avocat", "text", "About Us Header", "home_page", 14);
create_setting($wp_customize, 'about_us_txt', "Avocat is more than just a theme. It's a statement about your business, your life, your team. It's a celebration of all things legal and a way to show the world that you matter, a lot. It's dead simple to use and you can customize the colors, the text, the icons, everything.", "text", "Sub-banner Header", "home_page", 15);
create_setting($wp_customize, 'about_us_hdr', "Meet Our Team", "text", "Our Team Header", "home_page", 16);
create_setting($wp_customize, 'parallax_one', get_template_directory_uri() . '/images/supreme_court.jpg', "image", "Top Parallax Image", "home_page", 17);
create_setting($wp_customize, 'soc-fb', "#", "text", "Facebook Link", "footer", 1);
create_setting($wp_customize, 'soc-tw', "#", "text", "Twitter Link", "footer", 2);
create_setting($wp_customize, 'soc-go', "#", "text", "Google+ Link", "footer", 3);
create_setting($wp_customize, 'soc-li', "#", "text", "LinkedIn Link", "footer", 4);
create_setting($wp_customize, '404_hdr', "Oops! That page can’t be found.", "text", "Not Found Header", "not_found", 2);
create_setting($wp_customize, '404_text', "It looks like nothing was found at this location. Maybe try one of the links below or a search?", "text", "Not Found Text", "not_found", 3);
}
add_action( 'customize_register', 'mytheme_customize_register' );
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 200, 200, true ); // Normal post thumbnails
add_image_size( 'single-post-thumbnail', 400, 9999 ); // Permalink thumbnail
function mytheme_customize_css()
{
?>