This file contains 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 | |
/** | |
* Return bordering french area from one area number | |
* Thanks to https://gist.github.com/sunny/13803 for inspiration | |
* | |
* @param $areaNumber | |
* @return mixed | |
*/ | |
function bordering_areas($areaNumber) { | |
$borderingAreas = [ |
This file contains 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 | |
/** | |
* Remove default style (Geutenberg preset) in WordPress 5.9 theme | |
**/ | |
add_action( 'wp_enqueue_scripts', function(){ | |
wp_dequeue_style( 'global-styles' ); | |
}, 100 ); |
This file contains 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 | |
/** | |
* The function to display filter args for posts. | |
* @author jm silone | |
* needs to add a hook on your view (template) in this exampl we used | |
* a do_action('filter_by_categories',10); hook on target template | |
*/ | |
/** |
This file contains 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
name: nom_du_projet | |
recipe: wordpress # configure appserver for WP | |
config: | |
php: '8.1' # or maybe PHP 8.0? | |
via: nginx | |
database: mysql:5.7 | |
webroot: public # where my site files live | |
xdebug: true # easy debugging | |
services: | |
appserver: # the php/nginx server |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>My centered div wider than the parent div</title> | |
<style> | |
* { | |
box-sizing: border-box; | |
} | |
.parent { | |
max-width: 400px; |
This file contains 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 IMAGE META ON CATEGORIES | |
* @from : https://yourblogcoach.com/how-to-add-taxonomy-images-in-wordpress/#Add_Taxonomy_Images_to_Default_Taxonomy_Category | |
*/ | |
add_action( 'category_add_form_fields', 'add_category_image', 10, 2 ); | |
/** | |
* Add image field on category | |
* @param $taxonomy | |
* @return void |
This file contains 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
#!/bin/bash -e | |
# define developpement root path | |
devdir='' | |
# define commercial dir | |
commdir='' | |
# define database root password | |
dbpass='' |
This file contains 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 | |
/** | |
* Generates the star rating based on the number of reviews. | |
* | |
* @param int $reviews The number of reviews to calculate the star rating. | |
* @return string The HTML representation of the star rating. | |
*/ | |
function stars( $reviews ) | |
{ | |
$stars = ''; |