Skip to content

Instantly share code, notes, and snippets.

@axxe16
axxe16 / style.css
Created July 28, 2020 14:10
Permette di trasformare il modal in un layer a tutto schermo #modal #bootstrap #fullscreen #css #bootstrap4
.modal-dialog {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
max-width: none !important;
}
.modal-content {
height: auto;
@axxe16
axxe16 / functions.php
Created July 8, 2020 11:38
Sub pagina optioni ACF in impostazioni #acf #function #options
<?php
//aggiunge una pagina option dentro la sezione impostazioni
if( function_exists('acf_add_options_page') ) {
acf_add_options_sub_page(array(
'page_title' => 'Impostazioni Tema',
'menu_title' => 'Impostazioni Tema',
'parent_slug' => 'options-general.php',
));
}
@axxe16
axxe16 / functions.php
Created May 15, 2020 18:13
Crea filtro di ricerca per un campo ACF object #acf #filter #backend
//Crea filtro dropdown backend per un campo ACF di tipo object
/** Create the filter dropdown */
add_action( 'restrict_manage_posts', 'wpse45436_admin_posts_filter_restrict_manage_posts' );
<?php
function wpse45436_admin_posts_filter_restrict_manage_posts(){
global $post;
$type = 'materiale';
if (isset($_GET['post_type'])) {
$type = $_GET['post_type'];
}
@axxe16
axxe16 / function.php
Created May 8, 2020 12:09
customizzazione site reviews #plugin #wp #site-review #custom
//RIF: https://wordpress.org/plugins/site-reviews/
//
// ADDING CUSTOM FIELDS TO THE SUBMISSION FORM IS NOT ACTIVELY SUPPORTED!
// However, if you would like to try and do this on your own, this should help get you started.
//
/**
* Modifies the submission form fields
* Paste this in your active theme's functions.php file.
@axxe16
axxe16 / function.php
Created May 8, 2020 12:09
customizzazione site reviews #plugin #wp #site-review #custom
//RIF: https://wordpress.org/plugins/site-reviews/
//
// ADDING CUSTOM FIELDS TO THE SUBMISSION FORM IS NOT ACTIVELY SUPPORTED!
// However, if you would like to try and do this on your own, this should help get you started.
//
/**
* Modifies the submission form fields
* Paste this in your active theme's functions.php file.
@axxe16
axxe16 / debug_griglie.scss
Created May 4, 2020 10:25
Debug_griglie #scss #column #grid #debug
.row {
border-bottom:1px solid #aaa;
> div:nth-child(even) {
min-height:200px;
background-color:#ccc;
}
> div:nth-child(odd) {
min-height:200px;
background-color:#eee;
}
@axxe16
axxe16 / function.php
Created May 2, 2020 07:56
Woocommerce aggiungere login/logout a menù #woocommerce #woo #menù
add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );
function add_loginout_link( $items, $args ) {
if (is_user_logged_in() && $args->theme_location == 'primary') {
$items .= '<li><a href="'. wp_logout_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ) .'">Log Out</a></li>';
}
elseif (!is_user_logged_in() && $args->theme_location == 'primary') {
$items .= '<li><a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '">Log In</a></li>';
@axxe16
axxe16 / navbar_base.html
Created April 28, 2020 16:22
barra di navigazione base bootstrap #FCSBTBASE #navbar #bootstrap
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainMenu">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mainMenu">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home</a>
@axxe16
axxe16 / media_object_struttura.html
Last active April 27, 2020 17:57
Struttura Media Object #FCSBTBASE #media_object
<div class="media">
<img class="mr-3" src="https://dummyimage.com/80x80/000000/fff">
<div class="media-body">
<h5 class="mt-0">Media heading</h5>
Cras sit amet nibh libero, in gravida nulla.
</div>
</div>
@axxe16
axxe16 / griglia03_fissa_fluida.html
Created April 25, 2020 07:45
Sample griglia 03 #FCSBTBASE #L004
<main class="container">
Container Fisso
<div class="row">
<div class="col-6 col-sm-10 col-md-2 col-lg-1 col-xl-6">1</div>
<div class="col-6 col-sm-2 col-md-10 col-lg-11 col-xl-6">2</div>
</div>
</main><!-- /.container -->
<main class="container-fluid mt-4">
Container fluido