Custom Sections Dashboard Menu

function customSections_admin_menu() { add_menu_page( ”, // Page Title ‘Custom Sections’, // Menu Title ‘manage_options’, // Capabiliy required to see the menu ‘#’, // Menu_slug – # kills the link so we don’t end up somewhere strange since this is just…Continue reading

Custom Image Sizes

// Register the new image sizes in WordPress add_theme_support( ‘post-thumbnails’ ); add_image_size( ‘image-480’, 480, 9999 ); add_image_size( ‘image-720’, 720, 9999 ); add_image_size( ‘image-1440’, 1440, 9999 ); add_image_size( ‘image-1920’, 1920, 9999 ); // Include the new image sizes in the Add…Continue reading

Create Site Admin Role and Remove Other Roles

// Remove roles // https://wpmudev.com/blog/wordpress-delete-user-roles/ // Keep Subscriber so we have a default for new logins // Keep Editor so we have it to clone for Site Admin below $wp_roles = new WP_Roles(); $wp_roles->remove_role(“contributor”); $wp_roles->remove_role(“author”); add_action(‘init’, ‘cloneRole’); function cloneRole() {…Continue reading

Change Schema Type of All Posts in Specific Categories

add_filter(‘aioseo_schema_output’, ‘change_schema_type_in_specific_categories’); function change_schema_type_in_specific_categories($schema) { // Specify the category slugs you want to target $target_category_slugs = array(‘category1-slug’, ‘category2-slug’, ‘category3-slug’); foreach ($schema as &$schemaItem) { // Check if the post belongs to any of the specified categories if (isset($schemaItem[‘@type’]) && ‘NewsArticle’…Continue reading

Event URL (Additional Data) | Display Eventbrite Events

add_filter( ‘wfea_event_url’, function ( $url, $event_id, $organizer, $venue, $category ) { $code = ‘online’; if ( property_exists( $venue, ‘id’ ) ) { switch ( $venue->id ) { case 12345: $code = ‘venue1’; break; case 999893: $code = ‘venue2’; break; default:…Continue reading