Skip to content

Instantly share code, notes, and snippets.

Rikard Degler BeyondTheLoop

View GitHub Profile
@BeyondTheLoop
BeyondTheLoop / add-body-class-wp-posts-no-featured-image.txt
Last active Oct 10, 2018
Add body class to WordPress posts without featured image
View add-body-class-wp-posts-no-featured-image.txt
@BeyondTheLoop
BeyondTheLoop / execute-php-wp-widget.txt
Last active Oct 10, 2018
Executing PHP code in WordPress text widget
View execute-php-wp-widget.txt
/**
*
* Executing PHP code in WordPress text widget
*
*/
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
@BeyondTheLoop
BeyondTheLoop / disable-gutenberg-wordpress-5
Last active Dec 20, 2018
Disable Gutenberg editor in WordPress 5.x
View disable-gutenberg-wordpress-5
/**
*
* Disable Gutenberg Editor for all post types
*
*/
// disable for posts
add_filter('use_block_editor_for_post', '__return_false', 10);
// disable for post types
You can’t perform that action at this time.