Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rearrange/customizer options #36

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8f30725
Add customizer framework core file
NituShrestha Mar 29, 2021
8fe72da
Add - class-radiate-customizer.php file
NituShrestha Mar 29, 2021
c10a3ab
Add - required files of customizer framework
NituShrestha Mar 29, 2021
8bd826d
Add - Primary color option file
NituShrestha Mar 29, 2021
c2a2542
Add - background option
NituShrestha Mar 29, 2021
48d364f
Add Header option file
NituShrestha Mar 29, 2021
67a4a6b
Add - primary menu option file
NituShrestha Mar 29, 2021
11f4025
Add - Site identity option file
NituShrestha Mar 29, 2021
ed1f55b
Add - single post file
NituShrestha Mar 29, 2021
1b2bcbd
Add Front page featured option file
NituShrestha Mar 30, 2021
2a934dd
Add featured page section options
NituShrestha Mar 30, 2021
d2a6de1
Add Radiate upsell section
NituShrestha Mar 30, 2021
c36f941
Commented unrequired lines of code
NituShrestha Mar 30, 2021
32197eb
Add -depreciated functions.php file
NituShrestha Mar 30, 2021
bf3d362
Add - enqueue scripts
NituShrestha Mar 30, 2021
21b5638
minor fix
NituShrestha Mar 30, 2021
52d783f
Add - Demo import migration.php file
NituShrestha Mar 30, 2021
4060782
Add - Migration.php file
NituShrestha Mar 30, 2021
36c28ae
Fix - File path
NituShrestha Mar 30, 2021
49c6045
Add dark_css function in extras.php file
NituShrestha Mar 30, 2021
9db5c28
Add upsell section
NituShrestha Mar 30, 2021
022b7fe
Add dynamic css file
NituShrestha Mar 30, 2021
4149a83
Remove - unrequired section
NituShrestha Mar 30, 2021
1ecf6c7
Add - Dynamic CSS for Primary color option
NituShrestha Mar 31, 2021
d510fb0
Remove - unrequired code
NituShrestha Mar 31, 2021
93687a9
Add dynamic CSS for Primary color option
NituShrestha Mar 31, 2021
66bc8a8
Fix - dynamic css for primary dark color
NituShrestha Mar 31, 2021
bf54fec
Remove - unrequired code
NituShrestha Mar 31, 2021
d37375a
Remove - unrequired file
NituShrestha Mar 31, 2021
f776343
Remove - Unrequired codes of partial customize
NituShrestha Mar 31, 2021
b650255
Fix - site identity options
NituShrestha Mar 31, 2021
8a24881
minor fix
NituShrestha Mar 31, 2021
d8bf7b5
Delete unrequired file
NituShrestha Apr 5, 2021
fe60f2a
Remove - unrequired files and fix code indentation
NituShrestha Apr 5, 2021
41bac7d
Remove - unrequired section
NituShrestha Apr 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 19 additions & 33 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,38 +141,6 @@ function radiate_widgets_init() {

define( 'RADIATE_THEME_VERSION', $radiate_theme->get( 'Version' ) );

/**
* Enqueue scripts and styles.
*/
function radiate_scripts() {
// Load our main stylesheet.
wp_enqueue_style( 'radiate-style', get_stylesheet_uri() );

wp_enqueue_style( 'radiate-google-fonts', '//fonts.googleapis.com/css?family=Roboto|Merriweather:400,300' );

// Add Genericons, used in the main stylesheet.
wp_enqueue_style( 'radiate-genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.3.1' );

wp_enqueue_script( 'radiate-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );

wp_enqueue_script( 'radiate-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );

wp_enqueue_script( 'radiate-custom-js', get_template_directory_uri() . '/js/custom.js', array( 'jquery' ), false, true );

$radiate_header_image_link = get_header_image();
wp_localize_script( 'radiate-custom-js', 'radiateScriptParam', array( 'radiate_image_link' => $radiate_header_image_link ) );

if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}

wp_enqueue_script( 'html5shiv', get_template_directory_uri() . '/js/html5shiv.js', array(), '3.7.3', false );
wp_script_add_data( 'html5shiv', 'conditional', 'lte IE 8' );

}

add_action( 'wp_enqueue_scripts', 'radiate_scripts' );

/**
* Enqueue Google fonts and editor styles.
*/
Expand All @@ -184,6 +152,17 @@ function radiate_block_editor_styles() {
add_action( 'enqueue_block_editor_assets', 'radiate_block_editor_styles', 1, 1 );


/**
* Define URL Location Constants
*/
define( 'RADIATE_PARENT_DIR', get_template_directory() );
define( 'RADIATE_INCLUDES_DIR', RADIATE_PARENT_DIR . '/inc' );
define( 'RADIATE_CUSTOMIZER_DIR', RADIATE_INCLUDES_DIR . '/customizer' );

define( 'RADIATE_PARENT_URL', get_template_directory_uri() );
define( 'RADIATE_INCLUDES_URL', RADIATE_PARENT_URL . '/inc' );
define( 'RADIATE_CUSTOMIZER_URL', RADIATE_INCLUDES_URL . '/customizer' );

/**
* Implement the Custom Header feature.
*/
Expand All @@ -202,7 +181,12 @@ function radiate_block_editor_styles() {
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
require get_template_directory() . '/inc/customizer/class-radiate-customizer.php';
require get_template_directory() . '/inc/customizer/class-radiate-customizer-partials.php';
require_once RADIATE_INCLUDES_DIR . '/class-radiate-dynamic-css.php';
require_once RADIATE_INCLUDES_DIR . '/enqueue-scripts.php';
require_once RADIATE_INCLUDES_DIR . '/demo-import-migration.php';
require_once RADIATE_INCLUDES_DIR . '/depreciated/depreciated-functions.php';

/**
* Load Jetpack compatibility file.
Expand All @@ -220,3 +204,5 @@ function radiate_block_editor_styles() {
require get_template_directory() . '/inc/admin/class-radiate-upgrade-notice.php';
require get_template_directory() . '/inc/admin/class-radiate-theme-review-notice.php';
}


98 changes: 98 additions & 0 deletions inc/class-radiate-dynamic-css.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?php
/**
* Radiate dynamic CSS generation file for theme options.
*
* Class Radiate_Dynamic_CSS
*
* @package ThemeGrill
* @subpackage Radiate
* @since Radiate 1.4.0
*/

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Radiate dynamic CSS generation file for theme options.
*
* Class Radiate_Dynamic_CSS
*/
class Radiate_Dynamic_CSS {

/**
* Return dynamic CSS output.
*
* @param string $dynamic_css Dynamic CSS.
* @param string $dynamic_css_filtered Dynamic CSS Filters.
*
* @return string Generated CSS.
*/
public static function render_output( $dynamic_css, $dynamic_css_filtered = '' ) {

/**
* Variable declarations.
*/
// Primary color.
$primary_color = get_theme_mod( 'radiate_color_scheme', '#632e9b' );
$primary_dark = radiate_darkcolor( $primary_color, -50 );

// Generate dynamic CSS.
$parse_css = '';

// For primary color option.
$primary_color_css = array(
'.site-title a:hover, a, .header-search-icon:before, #content .comments-area a.comment-edit-link:hover, #content .comments-area a.comment-permalink:hover, #content .comments-area article header cite a:hover,#content .entry-meta span a:hover,#content .entry-title a:hover,.comment .comment-reply-link:hover, .comments-area .comment-author-link a:hover,.entry-meta span:hover,.site-header .menu-toggle,.site-header .menu-toggle:hover, #featured_pages a.more-link:hover, a#scroll-up span, .woocommerce .woocommerce-message::before' => array(
'color' => esc_html( $primary_color ),
),
'#masthead .search-form,.main-navigation a:hover,.main-navigation ul li ul li a:hover,.main-navigation ul li ul li:hover>a,.main-navigation ul li.current-menu-ancestor a,.main-navigation ul li.current-menu-item a,.main-navigation ul li.current-menu-item ul li a:hover,.main-navigation ul li.current_page_ancestor a,.main-navigation ul li.current_page_item a,.main-navigation ul li:hover>a, button,input[type=button],input[type=reset],input[type=submit], .main-small-navigation ul li ul li a:hover,.main-small-navigation ul li:hover,.main-small-navigation ul li a:hover,.main-small-navigation ul li ul li:hover>a,.main-small-navigation ul > .current_page_item, .main-small-navigation ul > .current-menu-item,.main-small-navigation ul li.current-menu-item ul li a:hover, a#back-top:before, .woocommerce ul.products li.product .onsale,.woocommerce span.onsale,.woocommerce #respond input#submit:hover, .woocommerce a.button:hover,
.wocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover' => array(
'background-color' => esc_html( $primary_color ),
),
'.main-small-navigation ul li ul li.current-menu-item > a' => array(
'background' => esc_html( $primary_color ),
),
'blockquote' => array(
'border-left-color' => esc_html( $primary_color ),
),
'#featured_pages a.more-link:hover' => array(
'border-color' => esc_html( $primary_color ),
),
);

$parse_css .= radiate_parse_css( '#632e9b', $primary_color, $primary_color_css );

// Add the custom CSS rendered dynamically, which is static.
$parse_css .= self::render_custom_output();

$parse_css .= $dynamic_css;

return apply_filters( 'radiate_theme_dynamic_css', $parse_css );

}

/**
* Function to output Custom CSS code, which does not have the specific CSS design option, ie, static CSS code.
*
* @return string
*/
public static function render_custom_output() {

$primary_color = get_theme_mod( 'radiate_color_scheme', '#632e9b' );
$primary_dark = radiate_darkcolor( $primary_color, -50 );

$radiate_custom_css = '';

if ( $primary_color && $primary_color != '#632e9b' ) {
$radiate_custom_css .= '@media (max-width: 768px){.better-responsive-menu .sub-toggle{background:' . $primary_dark . '}}';
}

return $radiate_custom_css;

}


}

21 changes: 0 additions & 21 deletions inc/customize-controls/class-radiate-additional-control.php

This file was deleted.

38 changes: 0 additions & 38 deletions inc/customize-controls/class-radiate-upsell-section.php

This file was deleted.

Loading