File: /home/ohirex/web/ohirex.com/public_html/wp-content/themes/revenueplus/functions.php_bak
<?php
/**
* revenueplus functions and definitions.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package revenueplus
*/
if ( ! function_exists( 'revenueplus_setup' ) ) :
function revenueplus_setup() {
load_theme_textdomain( 'revenueplus', 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add theme support for Custom Logo.
// Custom logo.
$logo_width = 300;
$logo_height = 70;
// If the retina setting is active, double the recommended width and height.
if ( get_theme_mod( 'retina_logo', false ) ) {
$logo_width = floor( $logo_width * 2 );
$logo_height = floor( $logo_height * 2 );
}
add_theme_support(
'custom-logo',
array(
'height' => $logo_height,
'width' => $logo_width,
'flex-height' => true,
'flex-width' => true,
)
);
/*
* 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' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'revenueplus' ),
'footer' => esc_html__( 'Footer Menu', 'revenueplus' ),
'mobile' => esc_html__( 'Mobile Menu', 'revenueplus' ),
) );
/*
* 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( 'revenueplus_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
add_editor_style( array( 'assets/css/editor-style.css', '' ) );
}
endif;
add_action( 'after_setup_theme', 'revenueplus_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
*/
// Set content-width.
global $content_width;
if ( ! isset( $content_width ) ) {
$content_width = 790;
}
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function revenueplus_sidebar_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'revenueplus' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'revenueplus' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => esc_html__( 'Home Sidebar (optional)', 'revenueplus' ),
'id' => 'home-sidebar',
'description' => esc_html__( 'Add widgets here.', 'revenueplus' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Column 1', 'revenueplus' ),
'id' => 'footer-1',
'description' => esc_html__( 'Add widgets here.', 'revenueplus' ),
'before_widget' => '<div id="%1$s" class="widget footer-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Column 2', 'revenueplus' ),
'id' => 'footer-2',
'description' => esc_html__( 'Add widgets here.', 'revenueplus' ),
'before_widget' => '<div id="%1$s" class="widget footer-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Column 3', 'revenueplus' ),
'id' => 'footer-3',
'description' => esc_html__( 'Add widgets here.', 'revenueplus' ),
'before_widget' => '<div id="%1$s" class="widget footer-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Column 4', 'revenueplus' ),
'id' => 'footer-4',
'description' => esc_html__( 'Add widgets here.', 'revenueplus' ),
'before_widget' => '<div id="%1$s" class="widget footer-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'revenueplus_sidebar_init' );
/**
* 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';
/**
* SVG Icons.
*/
require get_template_directory() . '/inc/classes/class-revenueplus-svg-icons.php';
/**
* Menu Walker.
*/
require get_template_directory() . '/inc/classes/class-revenueplus-walker-page.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/**
* Enqueues scripts and styles.
*/
function revenueplus_scripts() {
// load jquery if it isn't
wp_enqueue_script('jquery');
//wp_enqueue_script('jquery', get_template_directory_uri() . '/assets/js/jquery.js', array(), '', true );
// Enqueues Javascripts
wp_enqueue_script( 'superfish', get_template_directory_uri() . '/assets/js/superfish.js', array(), '', true );
wp_enqueue_script( 'html5', get_template_directory_uri() . '/assets/js/html5.js', array(), '', true );
wp_enqueue_script( 'bxslider', get_template_directory_uri() . '/assets/js/jquery.bxslider.js', array(), '', true );
wp_enqueue_script( 'index', get_template_directory_uri() . '/assets/js/index.js', array(), '20200320', true );
wp_enqueue_script( 'custom', get_template_directory_uri() . '/assets/js/jquery.custom.js', array(), '20200320', true );
// Enqueues CSS styles
wp_enqueue_style( 'revenueplus-style', get_stylesheet_uri(), array(), '20180523' );
wp_enqueue_style( 'genericons-style', get_template_directory_uri() . '/genericons/genericons.css' );
wp_enqueue_style( 'responsive-style', get_template_directory_uri() . '/responsive.css', array(), '20171012' );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'revenueplus_scripts' );
/**
* Post Thumbnails.
*/
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 250, 250, true ); // default Post Thumbnail dimensions (cropped)
add_image_size( 'featured_thumb', 740, 414, true );
add_image_size( 'post_thumb', 740, 414, true );
add_image_size( 'single_thumb', 740, 414, true );
add_image_size( 'grid_thumb', 355, 199, true );
add_image_size( 'widget_post_thumb', 80, 80, true );
}
/* Fix PHP warning */
/* function _get($str){
$val = !empty($_GET[$str]) ? $_GET[$str] : null;
return $val;
}
*/
// Disable WordPress 5.5+ Lazy Load
add_filter( 'wp_lazy_loading_enabled', '__return_false' );