Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Url parameter in link possible to display subpage in dark mode? #75810
    Tim Mueller
    Participant
    Premium Member

    Ok, what a pity that there is no function for this.

    I am now trying to solve this using user-defined fields, but I need to know which CSS file is responsible for the dark mode.

    Could you let me know?

    This is the code I am trying to work with so far:

    function add_dark_mode_css_custom_field() {
    if (get_post_meta(get_the_ID(), ‘dark_mode’, true) === ‘true’) {
    wp_enqueue_style(‘dark-mode’, get_stylesheet_directory_uri() . ‘/dark-mode.css’);
    }
    }
    add_action(‘wp_enqueue_scripts’, ‘add_dark_mode_css_custom_field’);

    • This reply was modified 6 months, 3 weeks ago by Tim Mueller.
Viewing 1 post (of 1 total)