Need folder for CPT templates for eg: single-{post_type}.php

i was able to solve some of it // defining the sub-directory so that it can be easily accessed from elsewhere as well. define( ‘WPSE_PAGE_TEMPLATE_SUB_DIR’, ‘pages’ ); function wpse227006_page_template_add_subdir( $templates = array() ) { // Generally this doesn’t happen, unless another plugin / theme does modifications // of their own. In that case, it’s better … Read more

Unzip_file causing Media file upload error

I got it to work without errors by using it inside add_attachment hook below, but now the problem is it runs on every media upload. function unzip_icon_fonts( $post_ID ){ $file_path = get_attached_file( $post_ID ); require_once(ABSPATH . ‘wp-admin/includes/file.php’); WP_Filesystem(); $destination = wp_upload_dir(); $destination_path = $destination[‘path’]; $unzipfile = unzip_file($file_path, $destination_path); } add_action( ‘add_attachment’, ‘unzip_icon_fonts’ ); I tried … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)