This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Remove Comments URL | |
* | |
*/ | |
add_filter('comment_form_default_fields', 'mb_remove_comments_url'); | |
function mb_remove_comments_url($fields){ | |
if(isset($fields['url'])) | |
unset($fields['url']); | |
return $fields; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"quotes": [ | |
{ | |
"quote":"Fa più rumore un albero che cade di una foresta che cresce.","author":"Lao Tzu"}, | |
{ | |
"quote":"il bisogno di avere ragione è il segno di una mente volgare.","author":"Albert Camus"}, | |
{ | |
"quote":"Sbagliare è umano, perseverare è diabolico.","author":"Sant'Agostino"}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Access-Control-Allow-Origin: *"); | |
header("Access-Control-Allow-Headers: *"); | |
// Variabili | |
$vars = array ( | |
ip => $_SERVER['REMOTE_ADDR'], | |
agent => $_SERVER['HTTP_USER_AGENT'], | |
current_page => (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", | |
fbp => $_COOKIE[_fbp], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Detect if a WordPress plugin is active | |
* (various examples) | |
*/ | |
/* When coding plugins that rely on another one, like Private Content for bbPress or Visual Attributes for WooCommerce, | |
you need to make if the WordPress Plugin is active to initialize your plugin routines or display a notice saying that | |
the required plugin must be activated. In this tutorial we’ll see how to detect whether a certain plugin is active in a | |
couple of ways. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://www.websavers.org/how-to-speed-up-wordpress/ | |
rewrite !\.(js|ico|gif|jpg|png|css|pdf|mov|mp3|eot|svg|ttf|woff|otf|txt|swf)$ /index.php break; | |
rewrite /wp-admin/$ /wp-admin/index.php break; | |
rewrite /$ /index.php break; | |
# enable gzip compression | |
gzip on; | |
gzip_min_length 1100; | |
gzip_buffers 4 32k; | |
gzip_types text/plain application/x-javascript text/xml text/css; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Remove Comments Author's link | |
* | |
*/ | |
function remove_commentauthorlink( $return, $author, $comment_ID ) { | |
return $author; | |
} | |
add_filter( 'get_comment_author_link', 'remove_commentauthorlink', 10, 3 ); | |
function remove_commentauthorurl() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ifModule mod_headers.c> | |
Header always set Content-Security-Policy "upgrade-insecure-requests;" | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MY_Widget extends WP_Widget { | |
public function __construct() { | |
parent::__construct( 'my_widget', 'My Widget', array( | |
'classname' => 'my-widget', | |
'description' => 'Testing checkbox fields.', | |
) ); | |
} | |
public function widget( $args, $instance ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container my-5 mt-5 mx-5 px-5"> | |
<div class="field"> | |
<label class="label is-size-4 has-text-weight-light"> Il tuo Nome </label> | |
<div class="control has-icons-left"> | |
[text* nome class:input placeholder "Nome"] | |
<span class="icon is-left"> | |
<i class="fa fa-user"></i> | |
</span> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Add Google Analytics | |
*/ | |
function mb_add_analytics() { | |
?> | |
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-69841290-2"></script> |
NewerOlder