PHP Web Development Wordpress

WordPress page template to access htaccess protected pdf file

WordPress page template to access htaccess protected pdf file: <?php /* pdf file download provision */ $download_success = false; $file_found = false; if(current_user_can( ‘manage_options’ )){ $doc = esc_url($_GET[‘doc’]); echo $file = str_replace(‘https://wma.ie/’,ABSPATH ,$doc); if (file_exists($file)) { $file_found = true; ob_clean(); flush(); header(‘Content-Description: File Transfer’); header(‘Content-Type: application/octet-stream’); header(‘Content-Disposition: attachment; filename=’.basename($file)); header(‘Content-Transfer-Encoding: binary’); header(‘Expires: 0’); header(‘Cache-Control: must-revalidate’); […]

Woocommerce Wordpress

Product Additional Information tab is not displaying

Additional Information tab is displayed by woocommerce in case product weight or product dimesions are set to a non-zero value. In case there is still need to display product addtional information tab then add the below code to your themes functions.php file. add_filter(‘wc_product_enable_dimensions_display’,’show_addtional_info_tab_always’); function show_addtional_info_tab_always(){ return true; } It generally needed when it requires to […]