Make WordPress Themes

Changeset 178705


Ignore:
Timestamp:
11/01/2022 03:13:46 PM (3 years ago)
Author:
themedropbox
Message:

New version of LimeasyBlog - 1.0.4

Location:
limeasyblog/1.0.4
Files:
8 added
1 deleted
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • limeasyblog/1.0.4/functions.php

    r177066r178705 
    1010if ( ! defined( 'LIMEASYBLOG_VERSION' ) ) {
    1111    // Replace the version number of the theme on each release.
    12     define( 'LIMEASYBLOG_VERSION', '1.0.3' );
    13 }
    14 
    15 if ( ! defined( 'LIMEASYBLOG_TEMPLATE_DIRECTORY_URI' ) ) {
    16     define( 'LIMEASYBLOG_TEMPLATE_DIRECTORY_URI', is_child_theme() ? get_theme_file_path() : get_template_directory_uri() );
     12    define( 'LIMEASYBLOG_VERSION', '1.0.4' );
     13}
     14
     15if ( ! defined( 'LIMEASYBLOG_DEFAULT_THEME_STYLE' ) ) {
     16    // Default theme style.
     17    define( 'LIMEASYBLOG_DEFAULT_THEME_STYLE', 'grand-retro' );
     18}
     19
     20if ( ! defined( 'limeasyblog_TEMPLATE_DIRECTORY_URI' ) ) {
     21    define( 'limeasyblog_TEMPLATE_DIRECTORY_URI', is_child_theme() ? get_theme_file_path() : get_template_directory_uri() );
    1722}
    1823
    โ€ฆโ€ฆ 
    219224        wp_enqueue_script( 'comment-reply' );
    220225    }
    221    
    222     wp_enqueue_style( 'limeasyblog-structure', get_template_directory_uri() . '/assets/styles/structure/structure.css', array(), LIMEASYBLOG_VERSION );
    223     wp_enqueue_style( 'limeasyblog-styles', get_template_directory_uri() . '/assets/styles/style/styles.css', array(), LIMEASYBLOG_VERSION );
     226
     227    // enqueue theme style
     228    limeasyblog_enqueue_theme_style();
    224229
    225230    wp_enqueue_script( 'limeasyblog-scripts', get_template_directory_uri() . '/assets/js/functions.js', array('jquery'), LIMEASYBLOG_VERSION, true );
  • limeasyblog/1.0.4/header.php

    r174650r178705 
    2222</head>
    2323
    24 <body <?php body_class('grand-retro'); ?>>
     24<body <?php body_class( limeasyblog_get_body_class() ); ?>>
    2525    <?php wp_body_open(); ?>
    2626    <div id="page" class="site">
  • limeasyblog/1.0.4/inc/customizer.php

    r177066r178705 
    3232        );
    3333    }
     34
     35    // theme settings section
     36    $wp_customize->add_section(
     37        'limeasyblog_theme_setings_section',
     38        array(
     39            'title' => __( 'Theme settings', 'limeasyblog' ),
     40            'priority' => 30,
     41        )
     42    );
     43
     44    $wp_customize->add_setting(
     45        'limeasyblog_theme_setting_design',
     46        array(
     47            'capability' => 'edit_theme_options',
     48            'sanitize_callback' => 'limeasyblog_sanitize_select',
     49            'default' => 'grand-retro',
     50        )
     51    );
     52
     53    $wp_customize->add_control(
     54        'limeasyblog_theme_setting_design',
     55        array(
     56            'type' => 'select',
     57            'section' => 'limeasyblog_theme_setings_section',
     58            'label' => __( 'Design', 'limeasyblog' ),
     59            'description' => __( 'Select theme design', 'limeasyblog' ),
     60            'choices' => array(
     61                'grand-retro' => 'Grand Retro',
     62                'blu-retro' => 'BluRetro',
     63            ),
     64        )
     65    );
    3466}
    3567add_action( 'customize_register', 'limeasyblog_customize_register' );
    โ€ฆโ€ฆ 
    5486
    5587/**
     88 * Sanitize select.
     89 *
     90 * @return mixed
     91 */
     92function limeasyblog_sanitize_select( $input, $setting ) {
     93
     94    // Ensure input is a slug.
     95    $input = sanitize_key( $input );
     96
     97    // Get list of choices from the control associated with the setting.
     98    $choices = $setting->manager->get_control( $setting->id )->choices;
     99
     100    // If the input is a valid key, return it; otherwise, return the default.
     101    return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
     102}
     103
     104/**
    56105 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
    57106 */
  • limeasyblog/1.0.4/inc/template-functions.php

    r173560r178705 
    3636}
    3737add_action( 'wp_head', 'limeasyblog_pingback_header' );
     38
     39/**
     40 * Get body classes
     41 */
     42if ( ! function_exists( 'limeasyblog_get_body_class' ) ) :
     43
     44    function limeasyblog_get_body_class() {
     45
     46        $design = get_theme_mod( 'limeasyblog_theme_setting_design' );
     47        $design = $design ? $design : LIMEASYBLOG_DEFAULT_THEME_STYLE;
     48
     49        switch ( $design ) {
     50            case 'grand-retro':
     51                $class = '_ulmt__grand-retro';
     52            break;
     53            case 'blu-retro':
     54                $class = '_ulmt__dos-theme';
     55            break;
     56            default:
     57                $class = $design;
     58        }
     59
     60        return $class;
     61    }
     62endif;
     63
     64/**
     65 * Enqueue theme styles
     66 */
     67if ( ! function_exists( 'limeasyblog_enqueue_theme_style' ) ) :
     68
     69    function limeasyblog_enqueue_theme_style() {
     70
     71        $style = get_theme_mod( 'limeasyblog_theme_setting_design' );
     72        $style = $style ? $style : LIMEASYBLOG_DEFAULT_THEME_STYLE;
     73
     74        wp_enqueue_style( 'limeasyblog-structure', get_template_directory_uri() . '/assets/styles/structure/structure.css', array(), LIMEASYBLOG_VERSION );
     75        wp_enqueue_style( "limeasyblog-styles-$style", get_template_directory_uri() . "/assets/styles/style/$style/styles.css", array(), LIMEASYBLOG_VERSION );
     76    }
     77endif;
  • limeasyblog/1.0.4/readme.txt

    r176625r178705 
    11=== LimeasyBlog ===
    22Contributors: unlimiTheme
    3 Tags: custom-logo, custom-menu, featured-images, right-sidebar, blog
     3Tags: custom-logo, custom-menu, featured-images, right-sidebar, blog, translation ready, accessibility ready, theme options, sticky post
    44Tested up to: 6.0.2
    55Stable tag: trunk
  • limeasyblog/1.0.4/style.css

    r177066r178705 
    55Author URI:
    66Description: LimeasyBlog is a super fast theme perfect for blogs. LimeasyBlog is created with a minimalist design. Easily use with all the page builders you like.
    7 Version: 1.0.3
     7Version: 1.0.4
    88Tested up to: 6.0.2
    99Requires PHP: 5.6
    โ€ฆโ€ฆ 
    1111License URI: LICENSE
    1212Text Domain: limeasyblog
    13 Tags: custom-logo, custom-menu, featured-images, right-sidebar, blog
     13Tags: custom-logo, custom-menu, featured-images, right-sidebar, blog, translation ready, accessibility ready, theme options, sticky post
    1414
    1515This theme, like WordPress, is licensed under the GPL.
Note: See TracChangeset for help on using the changeset viewer.