add_action('init', function() { // Fix footer meta for both original (460) and new (1294) footer templates $ids = array(460, 1294); foreach ($ids as $id) { if (!get_transient('agmad_footer_fixed_' . $id)) { // Essential Elementor rendering flag update_post_meta($id, '_elementor_edit_mode', 'builder'); // EHF template type (try all known meta key variants) update_post_meta($id, '_hfe_template_type', 'footer'); update_post_meta($id, 'ehf_template_type', 'type_footer'); // Display conditions - entire site update_post_meta($id, '_hfe_target_include_locations', array(array('type' => 'basic-global'))); update_post_meta($id, '_hfe_target_exclude_locations', array()); update_post_meta($id, '_hfe_target_user_roles', array('all')); // Also try UAE format update_post_meta($id, '_bsf_target_include_locations', json_encode(array(array('rule' => 'basic-global')))); // Publish the post if not already $post = get_post($id); if ($post && $post->post_status !== 'publish') { wp_update_post(array('ID' => $id, 'post_status' => 'publish')); } // Clear Elementor CSS cache delete_post_meta($id, '_elementor_css'); set_transient('agmad_footer_fixed_' . $id, 1, YEAR_IN_SECONDS); } } }, 1);