';
?>
get( 'Version') );
if ( ! defined( 'LP_COURSE_CPT' ) ) define( 'LP_COURSE_CPT', 'lp_course' );
if ( ! function_exists( 'edublink_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress 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 edublink_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on edublink_, use a find and replace
* to change 'edublink' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'edublink', 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' );
// Add support for Block Styles.
add_theme_support( 'wp-block-styles' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// Add support for editor styles.
add_theme_support( 'editor-styles' );
// Add support for responsive embedded content.
add_theme_support( 'responsive-embeds' );
/*
* Adding Images size.
*
* @link https://developer.wordpress.org/reference/functions/add_image_size/
*/
$height = edublink_set_value( 'featured_image_height', 430 );
$width = edublink_set_value( 'featured_image_width', 590 );
add_image_size( 'edublink-post-thumb', $width, $height, true );
add_image_size( 'edublink-post-thumb-2', 750, 750, true );
add_image_size( 'edublink-course-thumb', 450, 550, true );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'edublink' ),
) );
/*
* 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',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'edublink_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/**
* Add support for core custom logo.
*
* @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/
*/
add_theme_support( 'custom-logo', array(
'height' => 80,
'width' => 200,
'flex-width' => true,
'flex-height' => true,
) );
/**
* Registers an editor stylesheet for the theme.
* @link https://developer.wordpress.org/reference/functions/add_editor_style
* followed twentyseventeen theme and the link above
*/
add_editor_style( array( 'assets/css/style-editor.css', edublink_main_fonts_url() ) );
remove_theme_support( 'widgets-block-editor' );
}
endif;
add_action( 'after_setup_theme', 'edublink_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function edublink_content_width() {
// This variable is intended to be overruled from themes.
// Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}.
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
$GLOBALS['content_width'] = apply_filters( 'edublink_content_width', 640 );
}
add_action( 'after_setup_theme', 'edublink_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function edublink_widgets_init() {
register_sidebar(
apply_filters(
'edublink_default_sidebar_params',
array(
'name' => __( 'Sidebar Default', 'edublink' ),
'id' => 'sidebar-default',
'description' => __( 'Add widgets here.', 'edublink' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '