Skip to content

Instantly share code, notes, and snippets.

@nofh
nofh / b_tn.php
Last active August 29, 2015 13:57
pour un output html plus propre
<?php
function b_tn( $texte, $nb_retour_ligne_avant=1, $nb_tab=0, $nb_retour_ligne_apres=0 ) // backslash t, n
{
$contenu = "";
//avant
for( $i = 0; $i < $nb_retour_ligne_avant; $i++)
{
$contenu .= "\n";
}
@nofh
nofh / AccueilCPT.php
Last active August 29, 2015 13:57
parent pour la creation de custom post type
<?php
class AccueilCPT extends CustomPostType
{
private $post_type;
public function __construct()
{
$args = array( 'nom' => 'accueil' );
parent::__construct( $args );
@nofh
nofh / cm.php
Last active August 29, 2015 13:57
creer un commentaire html formater
<?php
function cm( $texte, $t=0, $hierachie=0 )
{
$contenu = '';
if( $hierachie == 0 )
{
$contenu = b_tn( '<!-- ' . strtoupper( $texte ) . ' --> ', 2, $t, 1 );
}
else
{
@nofh
nofh / Utiles.php
Last active August 29, 2015 13:57
Class utilitaire reprenant quelques methode utilisable souvent
<?php
class Utiles
{
public function __contstruct()
{
}
public function b_tn( $texte, $n_avant, $t, $n_apres )
{
$contenu = '';
#localisations img{ max-width: none; }