Adjust excerpt length in WordPress
Date: May 9, 2020
Add this to functions.php to achieve it:
function mytheme_custom_excerpt_length( $length ) {
return 20;
}
add_filter( ‘excerpt_length’, ‘mytheme_custom_excerpt_length’, 999 );
…
Add this to functions.php to achieve it:
function mytheme_custom_excerpt_length( $length ) {
return 20;
}
add_filter( ‘excerpt_length’, ‘mytheme_custom_excerpt_length’, 999 );
…
Add this to php.ini in order to enable logging for the PHP mail() function:
mail.add_x_header = On
mail.log =…
Pull the result of a cURL query via PHP.
Useful for parsing JSON APIs
$ch = curl_init();curl_setopt($ch,…
<?php
// Turn off error reporting
error_reporting(0);
// Report runtime errors
error_reporting(E_ERROR |…