文件操作 - functions.php
返回文件管理
返回主菜单
删除本文件
文件: /home/tecnoht/public_html/studiolegalebelloni--it/wp-content/themes/belloni/functions.php
编辑文件内容
<?php /* Contattaci */ function wpc_form_contatti( $atts ) { $secure = "AUSUUEDHHF64535SGGDGGSFS2WW33"; $html = ""; include_once get_template_directory() . "/form/form_contatti.php"; return $html; } add_shortcode( 'form_contatti', 'wpc_form_contatti'); /* ************************************************************************************** SMTP AND EMAIL FUNCTIONS * **************************************************************************************/ /* Mail in HTML */ function wpse27856_set_content_type(){ return "text/html"; } add_filter( 'wp_mail_content_type','wpse27856_set_content_type' ); /* PHP Mailer */ $SMTP_HOST = 'mail.planetcloud-host.com'; $SMTP_PORT = 465; $SMTP_USER = 'smtp@studiolegalebelloni.it'; $SMTP_PW = 'HYdt54$we3'; add_action( 'phpmailer_init', 'send_smtp_email' ); function send_smtp_email( $phpmailer ) { global $SMTP_HOST, $SMTP_PORT, $SMTP_PW, $SMTP_USER; $phpmailer ->isSMTP(); $phpmailer ->Host = $SMTP_HOST; // your SMTP server $phpmailer ->Port = $SMTP_PORT; $phpmailer ->SMTPDebug = 0; $phpmailer ->CharSet = "utf-8"; $phpmailer ->SMTPAuth = true; $phpmailer->SMTPSecure = 'ssl'; $phpmailer ->Username = $SMTP_USER; $phpmailer ->Password = $SMTP_PW; $phpmailer->action_function = 'wpse_mail_action'; //etc } /* head altre cose */ add_action( 'wp_head', 'my_header_code' ); function my_header_code() { echo "<title>Studio legale</title>"; // " . bloginfo( 'name' ) . " if ( $_SERVER['REQUEST_URI'] == "/" ) { ?> <script src="<?php bloginfo('stylesheet_directory'); ?>/js/flip/jquery.flip.js"></script> <link href="<?php bloginfo('stylesheet_directory'); ?>/js/flipbox/flip-box.min.css" rel="stylesheet" /> <script src="<?php bloginfo('stylesheet_directory'); ?>/js/flipbox/flip-box.js"></script> <?php } } /* style css */ function my_style_sheets() { wp_enqueue_style( 'main_style_css', get_template_directory_uri().'/style.css?v=1234',array(), '', 'screen' ); } add_action( 'wp_enqueue_scripts', 'my_style_sheets' ); /************************************************************************ disabilita tutte le emoticon Questo sistema WP è assurdo. IL mondo è nella merda *********************************************************************** *\ /** * Disable the emoji's */ function 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' ); remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); //add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); //add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 ); } add_action( 'init', 'disable_emojis' ); /* Style del code mirror ( per ora testo più piccolo ) LATO ADMIN ATTENZIONE */ add_action( 'admin_enqueue_scripts', 'load_admin_style' ); function load_admin_style() { //wp_register_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' ); //OR //wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' ); //$title = get_the_title(); ?> <style> .CodeMirror-wrap, #customize-controls .CodeMirror, .czr-input{ font-size: 12px!important; } /* I pulsanti di preview tablets e mobile scompiono col tema devo mettere questo CSS */ .devices button{ display: inline-flex!important; border-bottom: 4px solid transparent; } </style> <script> window.onload = function(){ var t=setTimeout( function(){ //jQuery(".is-search-input").val("Cerca") console.log("aggiorno top customize") var oFrame = jQuery("#customize-preview").find("iframe")[0] if ( oFrame ){ var FrameDocument = oFrame.contentDocument || oFrame.contentWindow.document var title = FrameDocument.title var link = oFrame.src.split("?")[0] console.log("link "+link.substr( link.length-1 )) var pageTitle = link.split("/") if ( link.substr( link.length-1 ) == "/") { pageTitle = link.split("/")[ pageTitle.length - 2 ] }else{ pageTitle = link.split("/")[ pageTitle.length - 1 ] } var st =" style='line-height: 1;border: solid 1px #777;text-decoration: none;position:absolute; left: 100px; top: 10px; padding: 7px 10px' " var bottone = "<a href='"+link+"' title='GoTo: "+link+"' "+st+">"+pageTitle+"</a>" jQuery("#customize-header-actions").append( bottone ) } }, 2000) } </script> <?php } /* Custom javacript */ function wpb_adding_scripts() { /* wp_register_script('my_amazing_script', get_template_directory_uri() . '/removeArrows.js', array('jquery'),'1.1', true); wp_enqueue_script('my_amazing_script'); */ ?> <style> /* Allineamento del menù non funziona*/ .nb-collapsible-mobile-menu{ display: block!important; text-align: center; } .sek-ham__span-wrapper .line{ height: 2px!important; color: #111111!important; border-top: 2px solid #111!important; } </style> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-1VLX8MZRT7"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-1VLX8MZRT7'); </script> <script> window.onload = function(){ //jQuery(".is-search-input").val("Cerca") //console.log("cambio lingua cerca") } </script> <?php } //add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts', 999 ); add_theme_support( 'menus' ); //https://wordpress.stackexchange.com/questions/13798/remove-empty-paragraphs-from-the-content remove_filter('the_content', 'wpautop'); //https://www.isitwp.com/disable-automatic-formatting/ remove_filter('the_content', 'wptexturize'); remove_filter('the_excerpt', 'wptexturize'); // https://wordpress.stackexchange.com/questions/130075/stop-wordpress-automatically-adding-br-tags-to-post-content remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' ); function wpse_wpautop_nobr( $content ) { return wpautop( $content, false ); } add_filter( 'the_content', 'wpse_wpautop_nobr' ); add_filter( 'the_excerpt', 'wpse_wpautop_nobr' ); ?>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件