Child Theme functions.php

Posted in: Newspaper
Post count: 40

Hello,

I’am new to child themes. But I need to add a code line into the functions.php

How do I add that.

Just install the child theme and put it in or is it not that easy?

Code:
/**
* separate media categories from post categories
* use a custom category called ‘category_media’ for the categories in the media library
*/
add_filter( ‘wpmediacategory_taxonomy’, function(){ return ‘category_media’; } ); //requires PHP 5.3 or newer

Thank’s

Post count: 1043

Yes. Put the code below this code inside the functions.php for the child theme.

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 1001);
function theme_enqueue_styles() {
    wp_enqueue_style('td-theme', get_template_directory_uri() . '/style.css', '', TD_THEME_VERSION, 'all' );
    wp_enqueue_style('td-theme-child', get_stylesheet_directory_uri() . '/style.css', array('td-theme'), TD_THEME_VERSION . 'c', 'all' );}

(I don’t work here).

Post count: 40

I tryed it out didn’t work. The code is not loading at all.

https://imgur.com/a/J0d7wDd

Post count: 1043

You did not follow the instructions. I said BELOW not above the code. From line 32.

Post count: 40

I had to activate the child theme too. Didn’t knew that too.

Never dealt with them before hand.

Thank’s for the help!

Post count: 1043

You are welcome.

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