Snippets

scissors

FORCE load new style.css

Put this code in your child theme header.php. It will check to see if it needs to reload a newer version of your stylesheet, even if you are heavily caching your site! Thanks for this gem Ben from Dev Cereal!

<!-- FLUFFYTECH: START force load style.css if it's new  --> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" />Edit

 

 

RE_DIRECT to homepage after login

Put this code in your child theme functions.php

/* FLUFFYTECH: re-direct on homepage after login --------------------------- */ function login_redirect( $redirect_to, $request, $user ){ return home_url('/'); } add_filter( 'login_redirect', 'login_redirect', 10, 3 );

 

 

DISABLE WordPress front-end Admin Bar for all users

Put this code in your child theme functions.php

/* FLUFFYTECH: Disable WordPress Front-end Admin Bar for all users ---------------------------------------------------------------- */ show_admin_bar(false);

 

 

REMOVE edit button on front-end for specific user roles (Editor)

Put this code in your child theme functions.php

/* FLUFFYTECH: REMOVE edit button on FRONT-END for specific user role (editor) -------------------------------------------------------------- */ if ( current_user_can('editor') ) add_filter( 'edit_post_link', '__return_false' );

 

 

STOP comments period

A small trick is checking your current theme and creating a new file comments.php (if you don’t have). On this file, you just place this code:

<!-- FLUFFYTECH: STOP ALL COMMENTS!! --> <?php return false; ?>

It will prevent any bot to use your comment form for posting.

 

 

HIDE shortcodes ultimate button

Put this code in your child theme functions.php

/* FLUFFYTECH: HIDE shortcodes ultimate button --------------------------- */ function fluffytech_hide_shortcodes_ultimate_button() { ?><style type="text/css">.su-generator-button {display:none !important;}</style><?php } add_action( 'admin_head', 'fluffytech_hide_shortcodes_ultimate_button' );

 

 

QUERY OBJECT

Query the current object (page, taxonomy, post etc..) and show it’s attributes

<?php
$queried_object = get_queried_object();
var_dump( $queried_object );
?>

 

MAILTO:

It is not possible to have html in the body of the email if you to generate it using mailto: – but you can generate a link here which adds body text and a subject automatically

https://e-mailer.link/en/

Facearse Tweep Internetmail

Leave a fluffy comment...

Your email address will not be published. Required fields are marked *