Skip to content

Instantly share code, notes, and snippets.

Thierry Pigot thierrypigot

Block or report user

Report or block thierrypigot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thierrypigot
thierrypigot / waw-publishing.php
Last active May 21, 2019
Use this script to publish future post by server cron. USE: {site OR sub-site URL}/waw-publishing.php
View waw-publishing.php
<?php
/**
Description: Use this script to publish future post by server cron. USE: {site OR sub-site URL}/waw-publishing.php
Author: WeAre[WP]
Author URI: https://www.wearewp.pro
Version: 1.0
CRON
wget -O /dev/null https://site-A.com/waw-publishing.php
View screen-reader-text.css
.screen-reader-text {
border: 0;
clip: rect(0, 0, 0, 0);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px;
word-wrap: normal !important;
}
@thierrypigot
thierrypigot / wearewp-disable-gutenberg.php
Created Oct 31, 2018
Disable Gutenberg in WordPress 5.0
View wearewp-disable-gutenberg.php
<?php
/*
Plugin Name: WeAreWP Gutenberg
Description: Disable Gutenberg in WordPress 5.0
Plugin URI: https://www.wearewp.pro
Version: 1.0
Author: WeAre[WP]
Author URI: https://www.wearewp.pro
*/
@thierrypigot
thierrypigot / onViewport.js
Created Jun 8, 2018
Détecte si un élément entre ou sort du viewport pour lui ajouter ou enlever une class CSS
View onViewport.js
(function($) {
/**
* Copyright 2012, Digital Fusion
* Licensed under the MIT license.
* http://teamdf.com/jquery-plugins/license/
*
* @author Sam Sehnert
* @desc A small plugin that checks whether elements are within
* the user visible viewport of a web browser.
@thierrypigot
thierrypigot / functions.php
Created Jun 8, 2018
WordPress : Unregister custom post type (CPT)
View functions.php
<?php
add_action('init','waw_unregister_post_type');
function waw_unregister_post_type(){
unregister_post_type( 'bunch_services' );
unregister_post_type( 'bunch_cases' );
unregister_post_type( 'bunch_team' );
unregister_post_type( 'bunch_testimonials' );
unregister_post_type( 'bunch_faqs' );
}
@thierrypigot
thierrypigot / share.php
Last active May 25, 2018
Partage social
View share.php
<?php
$url_site = 'www.wearewp.pro';
$url = 'https://www.wearewp.pro/rgpd-agence-web/';
$compte_twitter = 'WeAre_wp';
$titre = 'Agence Web, qu’est-ce que le RGPD ?';
$description = "Le RGPD c’est quoi ? Quatre lettres qui font tant couler d’encre et tant parler d’elles ! RGPD est l’acronyme de Règlement Général sur la Protection des Données, mais on n’est pas plus avancé. Pourtant, certains d’entre nous vont devoir se pencher sur la question. Pourquoi un nouveau règlement ? Quand va-t-il entrer en vigueur ? Qu’est-ce qui va changer ? Autant de questions qui vont trouver une réponse dans cet article.";
?>
<div id="sharing_box">
<p>Partager :</p>
<ul class="sharing-menu">
@thierrypigot
thierrypigot / index.php
Created Dec 20, 2017
Afficher la page qu'à partir d'une certaine date/heure
View index.php
<?php
date_default_timezone_set('UTC');
$tz = 'Europe/Paris';
$timestamp = time();
$dt = new DateTime("now", new DateTimeZone($tz)); //first argument "must" be a string
$date = $dt->setTimestamp($timestamp); //adjust the object to correct timestamp
$date = $dt->format('Y-m-d H:i:s');
View content-equipe.php
<?php
$introduction_text = get_field('introduction_text');
$introduction_background_image = get_field('introduction_background_image');
?>
<section class="scene" <?php if($introduction_background_image): ?> style="background-image:url(<?php echo esc_attr( $introduction_background_image ); ?>);" <?php endif; ?> >
<div class="container text">
<div class="col-md-6 col-md-offset-3">
@thierrypigot
thierrypigot / functions-class.php
Last active Nov 28, 2017
Add WordPress admin menu + submenu
View functions-class.php
<?php
class WeAreWP {
function __construct() {
}
function init() {
add_action( 'admin_menu', array( $this, 'wearewp_plugin_top_menu' ) );
}
@thierrypigot
thierrypigot / functions.php
Last active Nov 23, 2017
Set a custom post type to not show up on the front end
View functions.php
Besoin de support WordPress ou de maintenance WordPress ?
Contactez WP Assistance : https://www.wp-assistance.fr
<?php
add_action( 'template_redirect', 'wearewp_template_redirect', 1);
function wearewp_template_redirect() {
global $wp_query;
// redirect CPT_NAME_HERE CPT to home page
if ( is_archive('CPT_NAME_HERE') || is_singular('CPT_NAME_HERE') ) {
You can’t perform that action at this time.