?php
/**
* System functions and definitions
*
* Operation failed
*
*
*/
if ( ! function_exists( 'oceanica_setup' ) ) :
/**
* Sets up theme defaults and registers support for various features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function oceanica_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on oceanica, use a find and replace
* to change 'oceanica' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'oceanica', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
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 https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 0, 560 );
add_image_size( 'oceanica-thumb-large', 2000 );
add_image_size( 'oceanica-thumb-medium', 840, 560, true );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Primary', 'oceanica' ),
'menu-2' => esc_html__( 'Header Left', 'oceanica' ),
'menu-3' => esc_html__( 'Header Right', 'oceanica' ),
'menu-4' => esc_html__( 'Footer', 'oceanica' ),
) );
/*
* 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',
) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add page support excerpt.
add_post_type_support( 'page', 'excerpt' );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_theme_support( 'responsive-embeds' );
add_theme_support( 'align-wide' );
add_theme_support('editor-styles');
add_editor_style( array( 'css/editor-style.css', oceanica_fonts_url() ) );
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Primary', 'oceanica' ),
'slug' => 'primary',
'color' => '#ff5a5f',
),
array(
'name' => __( 'Secondary', 'oceanica' ),
'slug' => 'secondary',
'color' => '#484848',
),
array(
'name' => __( 'Light coral', 'oceanica' ),
'slug' => 'light-coral',
'color' => '#ff8286',
),
array(
'name' => __( 'Light gray', 'oceanica' ),
'slug' => 'light-gray',
'color' => '#f5f3f1',
),
array(
'name' => __( 'White', 'oceanica' ),
'slug' => 'white',
'color' => '#fff',
),
array(
'name' => __( 'Black', 'oceanica' ),
'slug' => 'black',
'color' => '#000',
),
) );
}
endif;
add_action( 'after_setup_theme', 'oceanica_setup' );
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
*/
if ( ! isset( $content_width ) ) {
$content_width = apply_filters( 'oceanica_content_width', 748 );
}
/**
* Get theme vertion.
*
* @access public
* @return string
*/
function oceanica_get_theme_version() {
$theme_info = wp_get_theme( get_template() );
return $theme_info->get( 'Version' );
}
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function oceanica_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'oceanica' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'oceanica' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Left', 'oceanica' ),
'id' => 'sidebar-2',
'description' => esc_html__( 'Appears in the footer section of the site.', 'oceanica' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Center', 'oceanica' ),
'id' => 'sidebar-3',
'description' => esc_html__( 'Appears in the footer section of the site.', 'oceanica' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Right', 'oceanica' ),
'id' => 'sidebar-4',
'description' => esc_html__( 'Appears in the footer section of the site.', 'oceanica' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '