Exclude Specific Categories from RSS Feed

/** * Exclude a category or multiple categories from the feeds. * If you want to exclude multiple categories, use a comma-separated list: “-15, -5, -6”. * Make sure to prefix the category id(s) with a minus “-“. * *…Continue reading

Allow SVG Files Upload

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Set a Minimum Word Count for Posts

/** * Prevent publishing posts under a minimum number of words. * * @param int $post_id The id of the post. * @param WP_Post $post The post object. * * @return void */ function wpcode_snippet_publish_min_words( $post_id, $post ) { //…Continue reading

Set oEmbed Max Width

function wpcode_snippet_oembed_defaults( $sizes ) { return array( ‘width’ => 400, ‘height’ => 280, ); } add_filter( ’embed_defaults’, ‘wpcode_snippet_oembed_defaults’ );Continue reading

Display the Last Updated Date

$u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); // Only display modified date if 24hrs have passed since the post was published. if ( $u_modified_time >= $u_time + 86400 ) { $updated_date = get_the_modified_time( ‘F jS, Y’ );…Continue reading