FM-Wiki

How to Package Theme options Build to Static State

by: Paul | Published: 2021-11-19

Steps on to Package Theme options Build to Static State when a client cancels.
WP-SCSS's dynamic CSS to static local css.

  1. get the compiled css on Assets > Styles > css > theme-options> style.css

  2. move copied code to a static css file ie. themestyles.css (include css.map if needed)

  3. delete the wp-scss compiled file if needed functions > enqueue-scripts.php , normally found in line 64

    // Theme Options
    wp_enqueue_style( 'theme-options-css', get_template_directory_uri() . '/assets/styles/css/theme-options/style.css', array(), filemtime(get_template_directory() . '/assets/styles/css/theme-options'), 'all' );

  4. enqueue the new CSS static file on functions > enqueue-scripts.php ie

make sure to enqueue to the right folder location in this case /assets/styles/css/themestyles.css
// New theme options
wp_enqueue_style( 'theme-styles-css', get_template_directory_uri() . '/assets/styles/css/themestyles.css', array(), filemtime(get_template_directory() . '/assets/styles/css'), 'all' );
5. Delete ACF fields theme styles

============

Setting Static Navigation Type:

  1. on Header.php from line 111 to 119 replace with the a set navigation type. either replace the conditional code or just edit the else statement. ie below.
    get_template_part( 'parts/navs/navigation', 'type-2' );
  2. on functions > enqueue-scripts.php match the css with the type selected above.
    wp_enqueue_style( 'navigation-default-css', get_template_directory_uri() . '/assets/styles/css/navigation-menu-styles/navigation-types/navigation-type-2.css', array(), filemtime(get_template_directory() . '/assets/styles/css/navigation-menu-styles/navigation-types'), 'all' );

===========

Removing Theme Options PHP

  1. Comment out Line 55 to 56

// Customize the Theme Options
// require_once(get_template_directory().'/functions/theme-options.php');
main file can be found @ Functions folder > Theme-options.php

BONUS: if there is a developer option for wp_scss_will_always_recompile on theme settings please delete that too.

TAKE A SIP OF COFFEE

Back to All Notes