From 0f9e1492cc92120dbfe18b4bee2ae3c8518d761d Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Mon, 15 Jul 2024 22:55:37 -0700 Subject: [PATCH] changed orgization --- assets/css/mt-customizer-styles.css | 25 --------- header.php | 35 +++++++++++++ .../mt-customizer-additional-open-graph.php | 35 ------------- .../mt-customizer-general-panel-options.php | 52 +++++++++---------- inc/customizer/mt-customizer.php | 18 +------ inc/template-functions.php | 24 --------- 6 files changed, 63 insertions(+), 126 deletions(-) delete mode 100644 inc/customizer/mt-customizer-additional-open-graph.php diff --git a/assets/css/mt-customizer-styles.css b/assets/css/mt-customizer-styles.css index a4ece16..5a7a4a7 100644 --- a/assets/css/mt-customizer-styles.css +++ b/assets/css/mt-customizer-styles.css @@ -364,28 +364,3 @@ .customize-control textarea { width: 100%; } - -/**--------------------------------------------- -Upsell section - ---------------------------------------------*/ - -#customize-controls .control-section-mt-upsell .accordion-section-title:hover, -#customize-controls .control-section-mt-upsell .accordion-section-title:focus { - background-color: #fff; -} - -.control-section-mt-upsell .accordion-section-title .button { - margin-top: -4px; - font-weight: 700; - margin-left: 8px; - background: #00d2ff; - background: -webkit-linear-gradient(to right, #3a7bd5, #00d2ff); - background: linear-gradient(to right, #3a7bd5, #00d2ff); - color: #fff; - border:none; -} - -.control-section-mt-upsell .accordion-section-title .button:hover { - background: #1FA3E8; - background:linear-gradient(#1FA3E8,#1FA3E8); -} \ No newline at end of file diff --git a/header.php b/header.php index e7b404d..7c2fb22 100644 --- a/header.php +++ b/header.php @@ -17,6 +17,41 @@ + ' . "\n"; + } + + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + } elseif (is_single() || is_page()) { + global $post; + if (has_post_thumbnail($post->ID)) { + $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'og-image-size'); + if ($thumbnail) { + echo '' . "\n"; + // Uncomment and adjust the following lines if needed + // $thumbnail_url = esc_url($thumbnail[0]); + // $thumbnail_parts = pathinfo($thumbnail_url); + // $thumbnail_new_url = $thumbnail_parts['dirname'] . '/' . $thumbnail_parts['filename'] . '-1536x878.' . $thumbnail_parts['extension']; + // echo '' . "\n"; + } + } else { + echo '' . "\n"; + } + + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + } +?> diff --git a/inc/customizer/mt-customizer-additional-open-graph.php b/inc/customizer/mt-customizer-additional-open-graph.php deleted file mode 100644 index bff4a89..0000000 --- a/inc/customizer/mt-customizer-additional-open-graph.php +++ /dev/null @@ -1,35 +0,0 @@ -'; - } - echo ''; - echo ''; - echo ''; - } elseif (is_single() || is_page()) { - global $post; - if (has_post_thumbnail($post->ID)) { - $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'og-image-size'); - if ($thumbnail) { - echo ''; - - //$thumbnail_url = esc_url($thumbnail[0]); - //$thumbnail_parts = pathinfo($thumbnail_url); - //$thumbnail_new_url = $thumbnail_parts['dirname'] . '/' . $thumbnail_parts['filename'] . '-1536x878.' . $thumbnail_parts['extension']; - //echo ''; - } - } else { - echo ''; - } - echo ''; - echo ''; - echo ''; - } -} -add_action('wp_head', 'add_opengraph_tags'); diff --git a/inc/customizer/mt-customizer-general-panel-options.php b/inc/customizer/mt-customizer-general-panel-options.php index 11370cd..3d95aa3 100644 --- a/inc/customizer/mt-customizer-general-panel-options.php +++ b/inc/customizer/mt-customizer-general-panel-options.php @@ -26,29 +26,6 @@ function sophia_after_dark_customize_general_panels_sections_register( $wp_custo ) ); - - /** - * Toggle field for Enable/Disable preloader. - * - */ - $wp_customize->add_setting( 'sophia_after_dark_enable_preloader', - array( - 'capability' => 'edit_theme_options', - 'default' => true, - 'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( new Sophia_After_Dark_Control_Toggle( - $wp_customize, 'sophia_after_dark_enable_preloader', - array( - 'label' => __( 'Enable Preloader', 'sophia-after-dark' ), - 'section' => 'sophia_after_dark_section_site', - 'settings' => 'sophia_after_dark_enable_preloader', - 'priority' => 5, - ) - ) - ); /** * Toggle field for Enable/Disable wow animation. @@ -72,7 +49,30 @@ function sophia_after_dark_customize_general_panels_sections_register( $wp_custo ) ) ); - + $wp_customize->add_control(new WP_Customize_Image_control( + $wp_customize, 'sophia_after_dark_home_og_image', array( + 'label' => __('Home Page Open Graph Image', 'sophia_after_dark'), + 'section' => 'sophia_after_dark_section_site', + 'settings' => 'sophia_after_dark_home_og_image', + 'priority' => 15, + ) + ) + ); + + $users = get_users(); + $user_choices = array(); + foreach ($users as $user) { + $user_choices[$user->ID] = $user->display_name; + } + $wp_customize->add_control('sophia_after_dark_home_og_user', array( + 'label' => __('Select User for Open Graph Tags', 'sophia_after_dark'), + 'section' => 'sophia_after_dark_section_site', + 'settings' => 'sophia_after_dark_home_og_user', + 'type' => 'select', + 'choices' => $user_choices, + 'priority' => 20, + ) + ); /** * Radio image field for Archive Sidebar * @@ -91,7 +91,7 @@ function sophia_after_dark_customize_general_panels_sections_register( $wp_custo 'description' => __( 'Choose site layout from available layouts', 'sophia-after-dark' ), 'section' => 'sophia_after_dark_section_site', 'settings' => 'sophia_after_dark_site_layout', - 'priority' => 15, + 'priority' => 25, 'choices' => array( 'site-layout--wide' => get_template_directory_uri() . '/assets/images/full-width.png', 'site-layout--boxed' => get_template_directory_uri() . '/assets/images/boxed-layout.png' @@ -118,7 +118,7 @@ function sophia_after_dark_customize_general_panels_sections_register( $wp_custo 'description' => __( 'Enable/disable Block-based Widgets Editor(since WordPress 5.8).', 'sophia-after-dark' ), 'section' => 'sophia_after_dark_section_site', 'settings' => 'sophia_after_dark_enable_widgets_editor', - 'priority' => 15, + 'priority' => 25, ) ) ); diff --git a/inc/customizer/mt-customizer.php b/inc/customizer/mt-customizer.php index 5f7b86e..285e884 100644 --- a/inc/customizer/mt-customizer.php +++ b/inc/customizer/mt-customizer.php @@ -24,21 +24,7 @@ function sophia_after_dark_customize_register( $wp_customize ) { $wp_customize->get_section( 'header_image' )->priority = '5'; $wp_customize->get_section( 'header_image' )->description = __( 'Header Image for only Innerpages', 'sophia-after-dark' ); $wp_customize->add_setting('sophia_after_dark_home_og_image', array('default' => '','sanitize_callback' => 'esc_url_raw','type' => 'option',)); - $wp_customize->add_control(new WP_Customize_Image_control($wp_customize, 'sophia_after_dark_home_og_image', array('label' => __('Home Page Open Graph Image', 'sophia_after_dark'),'section' => 'title_tagline','settings' => 'sophia_after_dark_home_og_image',))); - $wp_customize->add_setting('sophia_after_dark_home_og_user', array('default' => 1,'sanitize_callback' => 'absint','type' => 'option',)); - - $users = get_users(); - $user_choices = array(); - foreach ($users as $user) { - $user_choices[$user->ID] = $user->display_name; - } - $wp_customize->add_control('sophia_after_dark_home_og_user', array( - 'label' => __('Select User for Open Graph Tags', 'sophia_after_dark'), - 'section' => 'title_tagline', - 'settings' => 'sophia_after_dark_home_og_user', - 'type' => 'select', - 'choices' => $user_choices, - )); + $wp_customize->add_setting('sophia_after_dark_home_og_user', array('default' => 1,'sanitize_callback' => 'absint','type' => 'option',)); if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( @@ -102,7 +88,7 @@ add_action( 'customize_controls_enqueue_scripts', 'sophia_after_dark_customize_b /** * Add Kirki required file for custom fields */ -require get_template_directory() . '/inc/customizer/mt-customizer-additional-open-graph.php'; +#require get_template_directory() . '/inc/customizer/mt-customizer-additional-open-graph.php'; require get_template_directory() . '/inc/customizer/mt-customizer-custom-classes.php'; require get_template_directory() . '/inc/customizer/mt-customizer-panels.php'; diff --git a/inc/template-functions.php b/inc/template-functions.php index 27356a7..64d9e83 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -138,7 +138,6 @@ function sophia_after_dark_scripts() { wp_enqueue_style( 'sophia-after-dark-fonts', sophia_after_dark_fonts_url(), array(), null ); wp_enqueue_style( 'lightslider-style', get_template_directory_uri() .'/assets/library/lightslider/css/lightslider.min.css', array(), '' ); wp_enqueue_style( 'animate', get_template_directory_uri(). '/assets/library/animate/animate.min.css', array(), '3.5.1' ); - wp_enqueue_style( 'preloader', get_template_directory_uri() .'/assets/css/mt-preloader.css', array(), esc_attr( $sophia_after_dark_theme_version ) ); wp_enqueue_style( 'sophia-after-dark-style', get_stylesheet_uri(), array(), esc_attr( $sophia_after_dark_theme_version) ); wp_enqueue_style( 'sophia-after-dark-responsive-style', get_template_directory_uri(). '/assets/css/mt-responsive.css', array(), esc_attr( $sophia_after_dark_theme_version ) ); @@ -173,29 +172,6 @@ function sophia_after_dark_scripts() { add_action( 'wp_enqueue_scripts', 'sophia_after_dark_scripts' ); /*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -if ( ! function_exists( 'sophia_after_dark_preloader' ) ) : - - /** - * preloader function - * - * @since 1.0.0 - */ - function sophia_after_dark_preloader() { - $sophia_after_dark_enable_preloader = get_theme_mod( 'sophia_after_dark_enable_preloader', true ); - if ( false === $sophia_after_dark_enable_preloader ){ - return; - } -?> -
-
-
-
-
-