Automated Cat to Nav

add_action(‘save_post’, ‘check_and_add_categories_to_menu’, 20, 3); function check_and_add_categories_to_menu($post_id, $post, $update) { // Only run for posts and prevent autosaves if (wp_is_post_autosave($post_id) || wp_is_post_revision($post_id) || $post->post_type !== ‘post’) { return; } $locations = get_nav_menu_locations(); if (!isset($locations[‘primary’])) return; $menu_id = $locations[‘primary’]; $menu_items = wp_get_nav_menu_items($menu_id);…Continue reading

Automatically Set Featured Image from First Image in Post

function auto_set_featured_image() { global $post; if (!has_post_thumbnail() && $post->post_type == ‘post’) { $attached_image = get_children(“post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1”); if ($attached_image) { foreach ($attached_image as $attachment_id => $attachment) { set_post_thumbnail($post->ID, $attachment_id); break; } } } } add_action(‘save_post’, ‘auto_set_featured_image’);Continue reading

[advanced_tbsa_calculator]

/** * Shortcode: [advanced_tbsa_calculator] */ function advanced_tbsa_calculator_shortcode($atts) { ob_start(); ?> Parkland Modified Brooke Galveston Shriners–Cincinnati Rule of TenContinue reading

Docsbot with custom data

DocsBotAI.init( { id: ”, supportCallback: function ( event, history ) { event.preventDefault(); hideDocsBot(); }, identify: { name: yourtheme.user.name, email: yourtheme.user.email, userid: yourtheme.user.id } } );Continue reading