Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10268

    If I can dare, here is a snippet to see the list of available CSS skins for the Flashlight theme.

    Create your skins within the

    Code:
    /wp-content/themes/flashlight/css

    folder and name it following this schema:

    example1-skin.css

    example2-skin.css

    example3-skin.css

    Open this file:

    Code:
    /wp-content/themes/flashlight/includes/admin/register-admin-options.php

    Insert the following code after line 63 – before the

    Code:
    $avia_elements[] = array(

    definition:

    Code:
    /**
    * shows all the available skins
    * @since 13/03/2021
    * by camaleo, (Email address hidden if logged out)
    */
    $available_skins = array();
    $available_skins[‘Minimal (minimal-skin.css)’] = ‘minimal-skin.css';
    $available_skins[‘Dark (dark-skin.css)’] = ‘dark-skin.css';
    $data = scandir( TEMPLATEPATH . ‘/css’ );
    if(is_array($data)) {
    foreach($data as $key => $file) {
    if($file != ‘.’ && $file != ‘..’
    && $file != ‘minimal-skin.css’ && $file != ‘dark-skin.css’
    && substr($file, -9) == ‘-skin.css’) {
    $available_skins[‘Custom (‘ . $file . ‘)’] = $file;
    }
    }
    }

    Replace this code:

    Code:
    $avia_elements[] = array(
    “slug” => “styling”,
    “name” => “Which general color scheme should be used?”,
    “desc” => “You can choose between a light and a dark color scheme here.”,
    “id” => “stylesheet”,
    “type” => “select”,
    “std” => “minimal-skin.css”,
    “target” => array(“default_slideshow_target::.live_bg_default::set_id”),
    “subtype” => array(‘Minimal (minimal-skin.css)’=>’minimal-skin.css’,’Dark (dark-skin.css)’=>’dark-skin.css’));

    With this code:

    Code:
    $avia_elements[] = array(
    “slug” => “styling”,
    “name” => “Which general color scheme should be used?”,
    “desc” => “You can choose between a light and a dark color scheme here.”,
    “id” => “stylesheet”,
    “type” => “select”,
    “std” => “minimal-skin.css”,
    “target” => array(“default_slideshow_target::.live_bg_default::set_id”),
    // “subtype” => array(‘Minimal (minimal-skin.css)’=>’minimal-skin.css’,’Dark (dark-skin.css)’=>’dark-skin.css’)); /* camaleo: 13/03/2021 */
    “subtype” => $available_skins); /* camaleo: 13/03/2021 */

    When you load the theme options page, you will be able to select all the additional skins you have created in the drop down menu.

    As far as I understood the theme administration code is used in several themes, Kriesi please add this code in the main repository so everyone can use it if needed – and I can forget to edit the script at the next update ;-)

    If you do not like me to add similar clues in the future, please excuse me and let me know – I am so enthusiast I couldn’t resist.

    Gross gott!

    #67461

    Sorry replace:

    Code:
    $data = scandir( ABSPATH . ‘wp-content/themes/’ . THEMENAME . ‘/css’ );

    To:

    Code:
    $data = scandir( TEMPLATEPATH . ‘/css’ );

    #67462

    I updated your original post with your second update :)

    I’ll tag it for Kriesi to see if he wants to sticky it.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Flashlight: how to add custom stylesheet and see it in the drop-down menu’ is closed to new replies.