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
/** | |
* Define if the current page is a blog page or not | |
* | |
* @global $post | |
* @return bool true if current page is a blog page | |
*/ | |
function is_blog () { | |
global $post; | |
return ( ( is_archive() || is_author() || is_category() || is_home() || is_single() || is_tag() ) && get_post_type( $post ) == 'post' ); | |
} |
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
/* | |
* Remove Prefixes from archive titles | |
* | |
* @param string $title The title of the archive | |
* @return string $title The new title for the archive | |
*/ | |
function my_archive_title( $title ) { | |
if( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} |
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
/** | |
* Disable the emoji ability added from WP 4.2 | |
*/ | |
function my_disable_wp_emojicons() { | |
// all actions related to emojis | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); |
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
// Disable the adminbar for the frontend | |
add_filter('show_admin_bar', '__return_false'); |
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
// Remove unnecessary code from header | |
remove_action( 'wp_head', 'wp_generator' ); | |
remove_action( 'wp_head', 'rsd_link' ); | |
remove_action( 'wp_head', 'wlwmanifest_link'); | |
remove_action( 'wp_head', 'wp_shortlink_wp_head'); | |
// and also for WPML | |
global $sitepress; | |
remove_action( 'wp_head', array( $sitepress, 'meta_generator_tag' ) ); |
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
// Activate the link manager | |
add_filter('pre_option_link_manager_enabled', '__return_true'); |
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
function lower_wpseo_priority( $html ) { | |
return 'low'; | |
} | |
add_filter( 'wpseo_metabox_prio', 'lower_wpseo_priority' ); |
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
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;" | |
"_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;" | |
"esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" | |
"X-Poedit-Basepath: .\n" | |
"X-Poedit-SourceCharset: UTF-8\n" | |
"Plural-Forms: nplurals=2; plural=(n>1);\n" | |
"X-Poedit-SearchPath-0: ..\n" |
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 | |
/* | |
JSON list of all images files in current directory | |
*/ | |
header("Access-Control-Allow-Origin: *"); | |
$dir = "."; | |
$dh = opendir($dir); | |
$image_files = array(); |
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 | |
/** | |
* | |
* AUTODEPLOY GITHUB REPO ON HOSTING | |
* | |
* @author Vincent Lalanne <[email protected]> | |
* | |
* | |
* Step 1: create the SSH key on your hosting | |
* https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2 |
OlderNewer