Select Page

WordPress ACF get settings

<?php /** * Case studies * * @package understrap */ // Exit if accessed directly. defined( ‘ABSPATH’ ) || exit; ?> <?php $show_message = get_field(‘show_emergency_message’, ‘option’); if ($show_message == true) {...

Blank Login for WordPress

global $wp; //if coming from blank and not logged in //redirect to greencrop if (strpos($_SERVER[REQUEST_URI],”/wp-login.php”) === 0){ // carry on } else { if ($_SERVER[’HTTP_REFERER’] == “” && !is_user_logged_in()){...

Remove Yoast from CPT

I found that I can use this for multiple post types as well. just pass an array as the second argument: function my_remove_wp_seo_meta_box() { remove_meta_box(‘wpseo_meta’, [”Post_Type_1″,”Post_Type_2″], ‘normal’); }...

PHP string truncate

The Function Here’s the PHP truncate function (must be in tags): 1 2 3 4 5 6 7 8 9 function truncate($text, $chars = 120) { if(strlen($text) > $chars) { $text = $text.’ ‘; $text = substr($text, 0, $chars); $text = substr($text, 0, strrpos($text ,’...