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 query_posts( 'page_per_post=5&category_name=pippo' ); ?> | |
<?php if ( have_posts() ) : ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
/* Codice da eseguire in caso di contenuto trovato */ | |
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<h2> | |
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> |
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 | |
if( !function_exists( 'skam_setup') ){ | |
function skam_setup(){ | |
//Aggiungo il supporto al tag <title> | |
add_theme_support( 'title-tag' ); | |
//Mostro il link del feed all'interno di <head> | |
add_theme_support( 'automatic-feed-links' ); |
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 | |
if( !function_exists( 'skam_setup') ){ | |
function skam_setup(){ | |
} | |
} | |
add_action( 'after_setup_theme', 'skam_setup' ); | |
function skam_widgets_init() { |
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 | |
//Per Ruolo | |
function aggiungi_capability() { | |
// prendo il ruolo author | |
$ruolo = get_role( 'author' ); | |
//Aggiungo la mia Capability | |
$role->add_cap( 'aggiungi_prodotto' ); | |
} | |
add_action( 'admin_init', 'aggiungi_capability'); |
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 | |
function am_inserisci_autore() { | |
echo '<meta name="author" content="Andrea Barghigiani">\n'; | |
} //fine am_inserisci_autore() | |
/* Action Hook */ | |
add_action( 'wp_head', 'am_inserisci_autore' ); |
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 | |
add_action( 'wp_enqueue_scripts', 'carico_stili' ); | |
function carico_stili(){ | |
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' ) ); | |
} |
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 | |
/** | |
* Genesis Framework. | |
* | |
* Questo file mi sara' utile per gestire il layout | |
* delle pagine contenenti i singoli corsi | |
* | |
* @package Genesis\Templates | |
* @author Codeat | |
* @license GPL-2.0+ |
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
/**************************************** | |
Da inserire all'interno del file /percorso/file.js | |
*****************************************/ | |
jQuery(document).ready(function($) { | |
$("#toggle_it").click(function () { $(".to_toggle").toggle(1000); }); | |
$(".to_toggle").show(); | |
$("#toggle_it1").click(function () { $(".to_toggle1").toggle(1000); }); |
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
/**************************************** | |
Da inserire all'interno del file functions.php | |
*****************************************/ | |
if ( is_single( $id ) ){ //Sostituisci $id con l'ID della pagina specifica | |
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_script( 'mio-codice', get_template_directory_uri() . '/percorso/file.js', array( 'jquery' ) ); | |
} |
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 | |
//Manca proprio tutta la definizione della funzione | |
function conto_alla_rovescia( $int ){ | |
$int = intval($int); //Mi assicuro che sia un intero | |
$m = $int; //Mi creo una variabile per contare i passi | |
for( $i = 0; $i < $m; $i++ ){ | |
echo $int-- . "<br />"; | |
} | |
} |