Fix error: “Sorry, this file type is not permitted for security reasons”

Problem

You’re trying to upload a file into WordPress and you’re getting the error, “Sorry, this file type is not permitted for security reasons”.

 

Solution

Using FTP or File Manager, open your wp-config.php file (warning: for advanced users only). Add the following line to the file anywhere after <?php and without disrupting any other lines of code:

define('ALLOW_UNFILTERED_UPLOADS', true);

Stop Divi From Cropping Images (Blog, Gallery and Portfolio)

Problem

You’re using Divi Theme or Divi Builder, and your images are getting cropped in the Blog, Gallery and/or Portfolio Modules.

 

Solution – Blog

Add this code snippet to your functions.php file.

function ld_blog_crop_image_width($width) {
return 9999;
}
function ld_blog_crop_image_height($height) {
return 9999;
}
add_filter( ‘et_pb_blog_image_width’, ‘ld_blog_crop_image_width’ );
add_filter( ‘et_pb_blog_image_height’, ‘ld_blog_crop_image_height’ );

Solution – Gallery

Add this code snippet to your functions.php file.

function ld_gallery_crop_image_width($size) {
return 9999;
}
function ld_gallery_crop_image_height($size) {
return 9999;
}
add_filter( ‘et_pb_gallery_image_width’, ‘ld_gallery_crop_image_width’ );
add_filter( ‘et_pb_gallery_image_height’, ‘ld_gallery_crop_image_height’ );

Solution – Portfolio

Add this code snippet to your functions.php file.

function ld_portfolio_crop_image_width($width) {
return 9999;
}
function ld_portfolio_crop_image_height($height) {
return 9999;
}
add_filter( ‘et_pb_portfolio_image_width’, ‘ld_portfolio_crop_image_width’ );
add_filter( ‘et_pb_portfolio_image_height’, ‘ld_portfolio_crop_image_height’ );

Selecting a Specific “Child” in CSS

Problem

You have multiple objects with the same class, but you want to change the css for specific one(s)

 

Solutions

/* Selects the second <li> element in a list */
li:nth-child(2) {
  color: #6557ff;
}

/* Selects every fourth element
   among any group of siblings */
:nth-child(4n) {
  color: #6557ff;
}

 

You can also include calculations in the parethesis, or specify even or odd values

/* Selects every odd element in a list */
li:nth-child(2n+1) {
  color: #6557ff;
}

li:nth-child(odd) {
  color: #6557ff;
}