🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:functions.php
<?php /** * Ophiro Ventures Theme Functions * * @package Ophiro_Ventures * @version 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } define( 'OPHIRO_VERSION', '1.0.0' ); define( 'OPHIRO_DIR', get_template_directory() ); define( 'OPHIRO_URI', get_template_directory_uri() ); /** * Include modular theme files. */ require OPHIRO_DIR . '/inc/custom-post-types.php'; require OPHIRO_DIR . '/inc/enqueue.php'; require OPHIRO_DIR . '/inc/customizer.php'; require OPHIRO_DIR . '/inc/template-tags.php'; require OPHIRO_DIR . '/inc/widgets.php'; /** * Theme Setup */ function ophiro_setup() { load_theme_textdomain( 'ophiro', OPHIRO_DIR . '/languages' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script', ) ); add_theme_support( 'customize-selective-refresh-widgets' ); add_theme_support( 'custom-logo', array( 'height' => 60, 'width' => 200, 'flex-height' => true, 'flex-width' => true, ) ); add_theme_support( 'editor-styles' ); // Image sizes for luxury layouts add_image_size( 'ophiro-hero', 1920, 1080, true ); add_image_size( 'ophiro-card', 800, 500, true ); add_image_size( 'ophiro-thumb', 400, 300, true ); add_image_size( 'ophiro-gallery', 1200, 800, true ); // Navigation menus register_nav_menus( array( 'primary' => esc_html__( 'Primary Navigation', 'ophiro' ), 'footer' => esc_html__( 'Footer Navigation', 'ophiro' ), ) ); } add_action( 'after_setup_theme', 'ophiro_setup' ); /** * Content width */ function ophiro_content_width() { $GLOBALS['content_width'] = apply_filters( 'ophiro_content_width', 1400 ); } add_action( 'after_setup_theme', 'ophiro_content_width', 0 ); /** * Register widget areas */ function ophiro_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'ophiro' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'ophiro' ), 'before_widget' => '<section id="%1$s" class="o-widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h6 class="o-widget__title">', 'after_title' => '</h6>', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer Column 1', 'ophiro' ), 'id' => 'footer-1', 'description' => esc_html__( 'Footer widget area 1.', 'ophiro' ), 'before_widget' => '<div id="%1$s" class="o-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h6 class="o-footer-heading">', 'after_title' => '</h6>', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer Column 2', 'ophiro' ), 'id' => 'footer-2', 'description' => esc_html__( 'Footer widget area 2.', 'ophiro' ), 'before_widget' => '<div id="%1$s" class="o-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h6 class="o-footer-heading">', 'after_title' => '</h6>', ) ); } add_action( 'widgets_init', 'ophiro_widgets_init' ); /** * Custom excerpt length */ function ophiro_excerpt_length( $length ) { return 25; } add_filter( 'excerpt_length', 'ophiro_excerpt_length', 999 ); /** * Custom excerpt more */ function ophiro_excerpt_more( $more ) { return '…'; } add_filter( 'excerpt_more', 'ophiro_excerpt_more' ); /** * Add preload for critical fonts */ function ophiro_preload_fonts( $urls, $relation_type ) { if ( 'preconnect' === $relation_type ) { $urls[] = array( 'href' => 'https://fonts.googleapis.com', 'crossorigin', ); } return $urls; } add_filter( 'wp_resource_hints', 'ophiro_preload_fonts', 10, 2 ); /** * Disable WordPress emoji for cleaner code */ function ophiro_disable_emojis() { remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( 'wp_print_styles', 'print_emoji_styles' ); remove_action( 'admin_print_styles', 'print_emoji_styles' ); } add_action( 'init', 'ophiro_disable_emojis' ); /** * Add DNS prefetch for performance */ function ophiro_dns_prefetch() { echo '<link rel="dns-prefetch" href="//fonts.googleapis.com">' . "\n"; } add_action( 'wp_head', 'ophiro_dns_prefetch', 1 );
Save Changes
Cancel
Create New File
Create New Folder