'', 'random-default' => '', 'flex-height' => true, 'flex-width' => true, 'uploads' => true, 'width' => 900, 'height' => 100, 'default-text-color' => '#000000', 'wp-head-callback' => 'fpsychology_header_style', ) ); // add custom logo add_theme_support( 'custom-logo', array ( 'width' => 145, 'height' => 36, 'flex-height' => true, 'flex-width' => true, ) ); // add the visual editor to resemble the theme style add_editor_style( array( 'css/editor-style.css', get_template_directory_uri() . '/style.css' ) ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( 'primary' => __( 'Primary Menu', 'fpsychology' ), 'footer' => __( 'Footer Menu', 'fpsychology' ), ) ); // add Custom background add_theme_support( 'custom-background', array ('default-color' => '#FFFFFF') ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 1200, 0, true ); global $content_width; if ( ! isset( $content_width ) ) $content_width = 900; /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', ) ); } endif; // fpsychology_setup add_action( 'after_setup_theme', 'fpsychology_setup' ); /** * the main function to load scripts in the fPsychology theme * if you add a new load of script, style, etc. you can use that function * instead of adding a new wp_enqueue_scripts action for it. */ function fpsychology_load_scripts() { // load main stylesheet. wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array( ) ); wp_enqueue_style( 'animate-css', get_template_directory_uri() . '/css/animate.css', array( ) ); wp_enqueue_style( 'fpsychology-style', get_stylesheet_uri(), array( ) ); wp_enqueue_style( 'fpsychology-fonts', fpsychology_fonts_url(), array(), null ); // Load thread comments reply script if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Load Utilities JS Script wp_enqueue_script( 'viewportchecker', get_template_directory_uri() . '/js/viewportchecker.js', array( 'jquery' ) ); wp_enqueue_script( 'fpsychology-js', get_template_directory_uri() . '/js/utilities.js', array( 'jquery', 'viewportchecker' ) ); $data = array( 'loading_effect' => ( get_theme_mod('fpsychology_animations_display', 1) == 1 ), ); wp_localize_script('fpsychology-js', 'fpsychology_options', $data); wp_enqueue_script( 'mobile.customized', get_template_directory_uri() . '/js/jquery.mobile.customized.min.js', array( 'jquery' ) ); wp_enqueue_script( 'jquery.easing.1.3', get_template_directory_uri() . '/js/jquery.easing.1.3.js', array( 'jquery' ) ); wp_enqueue_script( 'camera', get_template_directory_uri() . '/js/camera.min.js', array( 'jquery' ) ); } add_action( 'wp_enqueue_scripts', 'fpsychology_load_scripts' ); /** * Load google font url used in the fPsychology theme */ function fpsychology_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by PT Sans, translate this to 'off'. Do not translate * into your own language. */ $opensansfont = _x( 'on', 'Open Sans font: on or off', 'fpsychology' ); if ( 'off' !== $opensansfont ) { $font_families = array(); $font_families[] = 'Open Sans'; $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,cyrillic-ext,cyrillic,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' ); } return $fonts_url; } /** * Display html code of all social sites */ function fpsychology_display_social_sites() { echo ''; } /** * Used to load the content for posts and pages. */ function fpsychology_the_content() { // Display Thumbnails if thumbnail is set for the post if ( has_post_thumbnail() ) { ?> '; echo ''; echo '

' . esc_html( get_bloginfo('name') ) . '

'; echo '
'; echo '' . esc_html( get_bloginfo('description') ) . ''; echo ''; } } /** * Displays the copyright text. */ function fpsychology_show_copyright_text() { $footerText = get_theme_mod('fpsychology_footer_copyright', null); if ( !empty( $footerText ) ) { echo esc_html( $footerText ) . ' | '; } } /** * widgets-init action handler. Used to register widgets and register widget areas */ function fpsychology_widgets_init() { // Register Sidebar Widget. register_sidebar( array ( 'name' => __( 'Sidebar Widget Area', 'fpsychology'), 'id' => 'sidebar-widget-area', 'description' => __( 'The sidebar widget area', 'fpsychology'), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', ) ); /** * Add Homepage Columns Widget areas */ register_sidebar( array ( 'name' => __( 'Homepage Column #1', 'fpsychology' ), 'id' => 'homepage-column-1-widget-area', 'description' => __( 'The Homepage Column #1 widget area', 'fpsychology' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', ) ); register_sidebar( array ( 'name' => __( 'Homepage Column #2', 'fpsychology' ), 'id' => 'homepage-column-2-widget-area', 'description' => __( 'The Homepage Column #2 widget area', 'fpsychology' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', ) ); // Register Footer Column #1 register_sidebar( array ( 'name' => __( 'Footer Column #1', 'fpsychology' ), 'id' => 'footer-column-1-widget-area', 'description' => __( 'The Footer Column #1 widget area', 'fpsychology' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', ) ); // Register Footer Column #2 register_sidebar( array ( 'name' => __( 'Footer Column #2', 'fpsychology' ), 'id' => 'footer-column-2-widget-area', 'description' => __( 'The Footer Column #2 widget area', 'fpsychology' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', ) ); // Register Footer Column #3 register_sidebar( array ( 'name' => __( 'Footer Column #3', 'fpsychology' ), 'id' => 'footer-column-3-widget-area', 'description' => __( 'The Footer Column #3 widget area', 'fpsychology' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', ) ); } add_action( 'widgets_init', 'fpsychology_widgets_init' ); /** * Displays the slider */ function fpsychology_display_slider() { ?>
This is Default Slide Title

You can completely customize Slide Background Image, Title, Text, Link URL and Text.

Read more', 'fpsychology' ); $defaultSlideImage = get_template_directory_uri().'/images/slider/' . $i .'.jpg'; $slideContent = get_theme_mod( 'fpsychology_slide'.$i.'_content', html_entity_decode( $defaultSlideContent ) ); $slideImage = get_theme_mod( 'fpsychology_slide'.$i.'_image', $defaultSlideImage ); ?>
add_section( 'fpsychology_social_section', array( 'title' => __( 'Social Sites', 'fpsychology' ), 'capability' => 'edit_theme_options', ) ); // Add facebook url $wp_customize->add_setting( 'fpsychology_social_facebook', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_facebook', array( 'label' => __( 'Facebook Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_facebook', 'type' => 'text', ) ) ); // Add google+ url $wp_customize->add_setting( 'fpsychology_social_google', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_google', array( 'label' => __( 'Google+ Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_google', 'type' => 'text', ) ) ); // Add twitter url $wp_customize->add_setting( 'fpsychology_social_twitter', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_twitter', array( 'label' => __( 'Twitter Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_twitter', 'type' => 'text', ) ) ); // Add LinkedIn url $wp_customize->add_setting( 'fpsychology_social_linkedin', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_linkedin', array( 'label' => __( 'LinkedIn Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_linkedin', 'type' => 'text', ) ) ); // Add Instagram url $wp_customize->add_setting( 'fpsychology_social_instagram', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_instagram', array( 'label' => __( 'instagram Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_instagram', 'type' => 'text', ) ) ); // Add RSS Feeds url $wp_customize->add_setting( 'fpsychology_social_rss', array( 'default' => get_bloginfo( 'rss2_url' ), 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_rss', array( 'label' => __( 'RSS Feeds URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_rss', 'type' => 'text', ) ) ); // Add Tumblr url $wp_customize->add_setting( 'fpsychology_social_tumblr', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_tumblr', array( 'label' => __( 'Tumblr Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_tumblr', 'type' => 'text', ) ) ); // Add YouTube channel url $wp_customize->add_setting( 'fpsychology_social_youtube', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_youtube', array( 'label' => __( 'YouTube channel URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_youtube', 'type' => 'text', ) ) ); // Add Pinterest page url $wp_customize->add_setting( 'fpsychology_social_pinterest', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_pinterest', array( 'label' => __( 'Pinterest Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_pinterest', 'type' => 'text', ) ) ); // Add VK page url $wp_customize->add_setting( 'fpsychology_social_vk', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_vk', array( 'label' => __( 'VK Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_vk', 'type' => 'text', ) ) ); // Add Flickr page url $wp_customize->add_setting( 'fpsychology_social_flickr', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_flickr', array( 'label' => __( 'Flickr Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_flickr', 'type' => 'text', ) ) ); // Add Vine page url $wp_customize->add_setting( 'fpsychology_social_vine', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_social_vine', array( 'label' => __( 'Vine Page URL', 'fpsychology' ), 'section' => 'fpsychology_social_section', 'settings' => 'fpsychology_social_vine', 'type' => 'text', ) ) ); /** * Add Slider Section */ $wp_customize->add_section( 'fpsychology_slider_section', array( 'title' => __( 'Slider', 'fpsychology' ), 'capability' => 'edit_theme_options', ) ); // Add slide 1 content $wp_customize->add_setting( 'fpsychology_slide1_content', array( 'default' => __( '

This is Default Slide Title

You can completely customize Slide Background Image, Title, Text, Link URL and Text.

Read more', 'fpsychology' ), 'sanitize_callback' => 'force_balance_tags', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_slide1_content', array( 'label' => __( 'Slide #1 Content', 'fpsychology' ), 'section' => 'fpsychology_slider_section', 'settings' => 'fpsychology_slide1_content', 'type' => 'textarea', ) ) ); // Add slide 1 background image $wp_customize->add_setting( 'fpsychology_slide1_image', array( 'default' => get_template_directory_uri().'/images/slider/' . '1.jpg', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'fpsychology_slide1_image', array( 'label' => __( 'Slide 1 Image', 'fpsychology' ), 'section' => 'fpsychology_slider_section', 'settings' => 'fpsychology_slide1_image', ) ) ); // Add slide 2 content $wp_customize->add_setting( 'fpsychology_slide2_content', array( 'default' => __( '

This is Default Slide Title

You can completely customize Slide Background Image, Title, Text, Link URL and Text.

Read more', 'fpsychology' ), 'sanitize_callback' => 'force_balance_tags', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_slide2_content', array( 'label' => __( 'Slide #2 Content', 'fpsychology' ), 'section' => 'fpsychology_slider_section', 'settings' => 'fpsychology_slide2_content', 'type' => 'textarea', ) ) ); // Add slide 2 background image $wp_customize->add_setting( 'fpsychology_slide2_image', array( 'default' => get_template_directory_uri().'/images/slider/' . '2.jpg', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'fpsychology_slide2_image', array( 'label' => __( 'Slide 2 Image', 'fpsychology' ), 'section' => 'fpsychology_slider_section', 'settings' => 'fpsychology_slide2_image', ) ) ); // Add slide 3 content $wp_customize->add_setting( 'fpsychology_slide3_content', array( 'default' => __( '

This is Default Slide Title

You can completely customize Slide Background Image, Title, Text, Link URL and Text.

Read more', 'fpsychology' ), 'sanitize_callback' => 'force_balance_tags', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_slide3_content', array( 'label' => __( 'Slide #3 Content', 'fpsychology' ), 'section' => 'fpsychology_slider_section', 'settings' => 'fpsychology_slide3_content', 'type' => 'textarea', ) ) ); // Add slide 3 background image $wp_customize->add_setting( 'fpsychology_slide3_image', array( 'default' => get_template_directory_uri().'/images/slider/' . '3.jpg', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'fpsychology_slide3_image', array( 'label' => __( 'Slide 3 Image', 'fpsychology' ), 'section' => 'fpsychology_slider_section', 'settings' => 'fpsychology_slide3_image', ) ) ); /** * Add Footer Section */ $wp_customize->add_section( 'fpsychology_footer_section', array( 'title' => __( 'Footer', 'fpsychology' ), 'capability' => 'edit_theme_options', ) ); // Add footer copyright text $wp_customize->add_setting( 'fpsychology_footer_copyright', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_footer_copyright', array( 'label' => __( 'Copyright Text', 'fpsychology' ), 'section' => 'fpsychology_footer_section', 'settings' => 'fpsychology_footer_copyright', 'type' => 'text', ) ) ); /** * Add Animations Section */ $wp_customize->add_section( 'fpsychology_animations_display', array( 'title' => __( 'Animations', 'fpsychology' ), 'capability' => 'edit_theme_options', ) ); // Add display Animations option $wp_customize->add_setting( 'fpsychology_animations_display', array( 'default' => 1, 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'fpsychology_animations_display', array( 'label' => __( 'Enable Animations', 'fpsychology' ), 'section' => 'fpsychology_animations_display', 'settings' => 'fpsychology_animations_display', 'type' => 'checkbox', ) ) ); } add_action('customize_register', 'fpsychology_customize_register'); function fpsychology_header_style() { $header_text_color = get_header_textcolor(); if ( ! has_header_image() && ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color || 'blank' === $header_text_color ) ) { return; } $headerImage = get_header_image(); ?>