Skip to content

Instantly share code, notes, and snippets.

@atomtigerzoo
atomtigerzoo / wordpress-hide-editor-on-pages.php
Last active December 29, 2020 17:25 — forked from ramseyp/hide-editor.php
Wordpress: Hide the editor on defined pages
/**
* Hide the main editor on specific pages
*/
define('EDITOR_HIDE_PAGE_TITLES', json_encode(array()));
define('EDITOR_HIDE_PAGE_TEMPLATES', json_encode(array('template-cars.php')));
/**
* Hide the main editor on defined pages
*
@atomtigerzoo
atomtigerzoo / wordpress-split-content-at-more-shortcode.php
Last active August 30, 2023 05:41
Wordpress: split the_content into parts at more-shortcode
function atz_split_content_at_more(){
// Split the content
$content_parts = preg_split('/<span id="more-\d+"><\/span>/i', get_the_content());
// Grab first part of content and apply filters
$result['intro'] = apply_filters('the_content', array_shift($content_parts));;
// Content has a more part?
if(!empty($content_parts)):
$result['more'] = apply_filters('the_content', implode($content_parts));
@atomtigerzoo
atomtigerzoo / htpasswd-one-liner
Created January 16, 2015 16:46
Create .htpasswd for nginx without Apache
Replace USERNAME with your wished login-username and hit enter:
printf "USERNAME:`openssl passwd -apr1`\n" >> .htpasswd