Child Theme Functions Editing

Posted in: Newspaper
Post count: 44

Hello Sir,
I am using child theme because we edited many files. I want to prevent some automatic generated thumbnail, so edited functions.php file and when pasted edited code into child theme functions then site is not working.
So how we can use child functions.php file.

Post count: 3343

Hi,
You need to copy only your modified code in Child Theme not the entire function.php file.
Here is the Child the documentation: https://codex.wordpress.org/Child_Themes

Hope this help!
Thanks for the message!

Post count: 44

Hello Sir,
I want only 326×159 image size, i have deleted all the thumb generation sizes in functions.php but how we can use in child functions.
Can you please give me child theme functions update file to stop other image sizes.

Post count: 322

Copy all thumb generation sizes from the functions.php file into the child-themes functions.php file and set each one to the size you want. If you want only 326×159 images then set all to that size and regenerate all thumbs. But only copy the code you are changing to the child-theme, not the whole file.

Post count: 44

Updated but not working
see the child theme updated code

/*
Theme Name: Newspaper Child theme
Theme URI: http://themeforest.net/user/tagDiv/portfolio
Description: Child theme made by tagDiv
Author: tagDiv
Author URI: http://themeforest.net/user/tagDiv/portfolio
Template: Newspaper
Version: 1
*/

@import url("../Newspaper/style.css");

/* ----------------------------------------------------------------------------

/* ----------------------------------------------------------------------------
thumbnails
*/

//the image sizes that we use
add_theme_support( 'post-thumbnails' );

//featured image
$td_crop_features_image = td_util::get_option('tds_' . 'crop_features_image');
if ($td_crop_features_image == '') {
add_image_size('featured-image', 326, 159, true);
} else {
add_image_size('featured-image', 326, 159, true);
}

//the small thumbnails
set_post_thumbnail_size( 326, 159, true );
add_image_size('art-thumb', 326, 159, true);

//small height, 1 col wide
add_image_size('art-wide', 326, 159, true);

//medium height 1 col wide
add_image_size('art-big-1col', 326, 159, true);

//the slides
add_image_size('art-slide-small', 326, 159, true);
add_image_size('art-slide-med', 326, 159, true);
add_image_size('art-slide-big', 326, 159, true);

//big slider - big image
add_image_size('art-slidebig-main', 326, 159, true);

//the gallery
add_image_size('art-gal', 326, 159, true);

*/

Post count: 322

set all to that size and regenerate all thumbs

Post count: 44

I don’t want other thumbnail. i want to stop extra image sizes that are saved in our wp-contact folder. i only want when we upload image then only single size 326×159 generate not more extra.
When we update main theme functions.php file then works fine but not in child theme functions.

Post count: 3343

Hi,
Leave the code in main theme if not work in Child, I’m not sure why not work in Child theme.

Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.