Skip to content

Instantly share code, notes, and snippets.

// display title
if (!function_exists('display_title_acf')) {
function display_title_acf($title = '', $tag = "h2", $class = '')
{
if (!empty($title)) {
echo '<' . $tag . ' class="title ' . $class . '">' . $title . '</' . $tag . '>';
}
}
}
if (!function_exists('storefront_site_title_or_logo')) {
/**
* Display the site title or logo
*
* @since 2.1.0
* @param bool $echo Echo the string or return it.
* @return string
*/
function storefront_site_title_or_logo($echo = true)
{
export class stickyScrollElement {
/**
* Constructs a new sticky instance.
*
* @param stickyItem Element parent contenant le sticky
* @param limiteWrapper container dans lequel le sticky doit se déplacer
* @param stickyNav Navigation sticky qui faudrait enlever des calculs
*/
constructor(
const menuSticky = () => {
const body = document.body;
const stickyMenu = document.querySelector(".wrapper-sticky-header"); // wrap your header with that
const menuHeight = stickyMenu.offsetHeight;
stickyMenu.style.height = menuHeight + 'px';
// const nav = document.querySelector(".page-header nav");
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php wp_head(); ?>
</head>
import $ from "jquery";
/******************************************/
/*************** PUBLICATIONS *************/
/******************************************/
$(function() {
var $publications = $('#container_loadResult_js');
var $seeMore = $("#load_more_js");
var $filterCategories = $('#filter_category_js');
var $filterTag = $('#filter_tag_js');
/**
* External dependencies
*/
import { isEmpty } from "lodash";
/**
* WordPress dependencies
*/
const { isBlobURL } = wp.blob;
function gutenberg_examples_dynamic() {
// automatically load dependencies and version
register_block_type( 'custom-e2s/bloc-left', array(
'api_version' => 2,
'render_callback' => function($attributes, $content ) {
$path = locate_template( 'templates/blocks/bloc-left.php' );
if ( file_exists( $path ) ) {
ob_start();
// -----------------------
/**
* Declare our custom attribute
*/
const setDecalageButton = (settings, name) => {
return Object.assign({}, settings, {
attributes: Object.assign({}, settings.attributes, {
decallage: { type: "boolean", default: false },
decallagevalue: { type: "number", default: 0 },
@annelyse
annelyse / ssh
Last active March 29, 2023 08:55
ajouter sa clé pubique sur le serveur, pour se connecter sans mot de passe
ssh-copy-id -i ~/.ssh/id_rsa.pub user@server