Create a new clean HTML-file with with no .js scripts etc
-
Hello Comrades,
I want to use some ACF-fields (Create this with WPUF) and create a new completely Clean HTML file with inline CSS. (Need to be clean because I want create a E-mail signature) Attached also the link to the template I was created with my code. Design is ok. But many SPAM-filters doesn’t like this signature when put in mail.
How do I do this the most simple way?
I Using Elementor and Hello Theme Elementor but code gets really messy with js-files and scripts, long elementor tags etc. I need code to be really Clean and minimal.
This is what I done myself (added a new theme function in childtheme) but have no idea if this is the way to go. I was in my code done a function inside a function and I dont know if this is correct.
My code works to create the new HTML-file, BUT the code not clean. I need to clean this code or do create a completely new HTML without theme css, styles, scripts etc.
Thanks in advise.
Code below or also in this URL: https://pastebin.com/ATKQJWR4
function vgsign( $post_id ) { $post_type = get_post_type($post_id); // only update the attorneys custom post type on save if ( "card" != $post_type ) return; $vpost = get_post($post_id); $filename = $vpost->post_name.".html"; header('Content-Description: File Transfer'); header('Content-Type: text/html'); // header('Content-Disposition: attachment; filename=signature.html'); header('Content-Transfer-Encoding: binary'); // header('Expires: 0'); // header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); // header('Pragma: public'); $urlcard = $vpost->post_name; $data=null; // $data.="PHOTO;TYPE=JPEG:" .$_POST['html5_1dp5ookdu861fkf1eq21qlu1j93']."\n"; //$data.="COPY THIS CODE BELOW TO HTML SIGNATURE:"."\n"; $data.= file_get_contents("https://mysite.io/a/".$urlcard."/?theme_template_id=1164"); //$data.="END:COPY THIS CODE ABOVE TO HTML SIGNATURE"; $filePath = get_template_directory()."/mailsign/".$filename; // you can specify path here where you want to store file. $file = fopen($filePath,"w"); fwrite($file,$data); fclose($file); // BEGINNING EXTRA FUNCTION IN FUNCTION - THIS CODE BELOW TO END-TAG I DONT KNOW IF YOU CAN PUT IN EXISTING function? add_action('after_setup_theme', 'cleanup'); function cleanup() { remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'feed_links', 2); remove_action('wp_head', 'feed_links_extra', 3); remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'start_post_rel_link', 10, 0); remove_action('wp_head', 'parent_post_rel_link', 10, 0); remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); remove_action('wp_head', 'print_emoji_detection_script', 7); remove_action('wp_head', 'rel_canonical'); remove_action('wp_head', 'rel_alternate'); remove_action('wp_head', 'wp_oembed_add_discovery_links'); remove_action('wp_head', 'wp_oembed_add_host_js'); remove_action('wp_head', 'rest_output_link_wp_head'); remove_action('rest_api_init', 'wp_oembed_register_route'); remove_action('wp_print_styles', 'print_emoji_styles'); remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10); remove_filter('pre_oembed_result', 'wp_filter_pre_oembed_result', 10); add_filter('embed_oembed_discover', '__return_false'); add_filter('show_admin_bar', '__return_false'); } // END EXTRA FUNCTION IN FUNCTION } add_action( 'save_post', 'vgsign', 101, 3 );
The page I need help with: [log in to see the link]
- The topic ‘Create a new clean HTML-file with with no .js scripts etc’ is closed to new replies.