-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp-function-image.php
More file actions
49 lines (39 loc) · 1.95 KB
/
wp-function-image.php
File metadata and controls
49 lines (39 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/// WP FUNCTIONS FOR IMAGES
/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
update_option( 'thumbnail_size_w', 525 ); // Set Thumbnail width - default 150
update_option( 'thumbnail_size_h', 525 ); // Set Thumbnail height - default 150
update_option( 'thumbnail_crop', 1 ); // Set Crop mode - 0 Soft, 1 Hard
update_option( 'medium_size_w', 768 ); // Set Thumbnail width - default 150
update_option( 'medium_size_h', 768 ); // Set Thumbnail height - default 150
update_option( 'medium_crop', 1 ); // Set Crop mode - 0 Soft, 1 Hard
update_option( 'large_size_w', 1920 ); // Set Thumbnail width - default 150
update_option( 'large_size_h', 1280); // Set Thumbnail height - default 150
update_option( 'large_crop', 1 ); // Set Crop mode - 0 Soft, 1 Hard
/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/// ADD MY SIZES - SIZE + RATIO
/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
add_action( 'after_setup_theme', 'wpdocs_theme_setup' );
function wpdocs_theme_setup() {
add_image_size( 'L-169', 1920, 1080, true );
add_image_size( 'L-43', 1920, 1440, true );
add_image_size( 'M-169', 768, 432, true );
add_image_size( 'M-43', 768, 576, true );
add_image_size( 'S-43', 525, 319, true );
}
/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/// SIZES DANS LE TABLEAU DE BORD
/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
add_filter('image_size_names_choose', 'add_custom_thumb');
function add_custom_thumb($sizes) {
$addsizes = array(
"large-169" => __( "1920 x 1080"),
"large-43" => __( "1920 x 1440"),
"medium-169" => __( "768 x 432"),
"medium-43" => __( "768 x 576"),
"small-43" => __( "525 x 319"),
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}