• Skip to primary navigation
  • Skip to main content
  • Skip to footer

altaneus

Pensées pour moi-même...

  • Home
  • Snippets
  • About

Cloudflare traffic only

19 May 2019 par Stefano

# BEGIN Cloudflare HTTP Header Check
<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{HTTP:CF-IPCountry} ^$
RewriteRule ^ - [F,L]
</IfModule>
#END Cloudflare HTTP Header Check

genesis_do_noposts

7 February 2019 par Stefano

// Change text of no post message.
add_filter( 'genesis_noposts_text', 'summit_change_search_text', 10, 2 );
function summit_change_search_text( $text ) {
  
    $text = __( 'Oups, ceci est étrange mais il semblerait que le résultat de la recherche n\'a pas abouti. Essayez à nouveau...', 'summit' );

    return $text;
}

Remove Dashboard Widgets

27 January 2019 par Stefano

<?php

// Remove unused Widgets from the Dashboard.
function dottaware_remove_dashboard_widgets() {
  
    // remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );   // At a Glance.
    
    // remove_meta_box( 'dashboard_activity', 'dashboard', 'normal'); // Activity.
  
    remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); // Recent Comments.
    remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );  // Incoming Links.
    
    // remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );   // Plugins.

    remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );  // Quick Press.

    // remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );  // Recent Drafts.

    remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );   // WordPress Events and News.

    remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );   // Other WordPress News.    
}
add_action( 'wp_dashboard_setup', 'dottaware_remove_dashboard_widgets', 99 );

// Remove the Welcome Panel from the Dashboard.
remove_action( 'welcome_panel', 'wp_welcome_panel');

// Remove the Try Gutenberg from the Dashboard.
remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );

Remove Post Metaboxes

20 January 2019 par Stefano

<?php

function dottaware_remove_post_metaboxes() {
    
    $args = array(
        'public'   => true,
    );
    
    foreach ( get_post_types( $args, 'names' ) as $post_type ) {
        remove_meta_box( 'postcustom', $post_type, 'normal' ); // Custom fields.
        remove_meta_box( 'trackbacksdiv', $post_type, 'normal' ); // Trackbacks.
        remove_meta_box( 'commentstatusdiv', $post_type, 'normal' ); // Comments status.
        remove_meta_box( 'commentsdiv', $post_type, 'normal' ); // Comments.
        
        remove_meta_box( 'genesis_inpost_seo_box', $post_type, 'normal' ); // Genesis SEO.
        remove_meta_box( 'genesis_inpost_layout_box', $post_type, 'normal' ); // Genesis Layout.
        remove_meta_box( 'genesis_inpost_scripts_box', $post_type, 'normal' ); // Genesis Scripts.
    }
}
add_filter( 'add_meta_boxes', 'dottaware_remove_post_metaboxes', 99 );

// alternative method.
// add_action( 'admin_menu', 'dottaware_remove_post_metaboxes', 99 );

Cache-Control pour les feuilles de style

11 March 2017 par Stefano

# BEGIN CSS cache duration - 2017-01-28
<filesMatch "\.(css)$">
    <IfModule mod_headers.c>
        Header set Cache-Control "max-age=3600, public, must-revalidate"
    </IfModule>
</FilesMatch>
# END CSS cache duration

Canonical Headers pour les images

11 March 2017 par Stefano

# BEGIN CDN SEO - 2017-01-28
<FilesMatch "\.(jpg|jpeg|png)$">
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteRule ^(.*)$ - [E=CANONICAL:https://%{HTTP_HOST}%{REQUEST_URI},NE]
    </IfModule>  
    <IfModule mod_headers.c>
        Header set Link '<%{CANONICAL}e>; rel="canonical"'
    </IfModule>
</FilesMatch>
# END CDN SEO
  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Go to Next Page »

Footer

Recent Posts

  • Jetpack Stats – il va falloir payer
  • Jetpack Personal : augmentation de prix
  • Générateurs de mots de passes
  • Générateur de GUID/UUID
  • Appareil photo du Samsung S22 Ultra

Categories

  • Apache
  • Cloudflare
  • DNS
  • Genesis
  • Infomaniak
  • Jetpack
  • Non classé
  • Outils
  • Photographie
  • Sécurité
  • Uncategorized
  • Wordpress
  • WP Rocket

Copyright © 2025 · Genesis Framework · WordPress · Log in