remove_setting( 'logistic_transport_theme_color_first' );
$wp_customize->remove_control( 'logistic_transport_theme_color_first' );
$wp_customize->remove_setting( 'logistic_transport_theme_color_second' );
$wp_customize->remove_control( 'logistic_transport_theme_color_second' );
$wp_customize->remove_section( 'logistic_transport_about_theme' );
$wp_customize->remove_setting( 'logistic_transport_menu_settings_premium_features' );
$wp_customize->remove_control( 'logistic_transport_menu_settings_premium_features' );
$wp_customize->remove_setting( 'logistic_transport_post_settings_premium_features' );
$wp_customize->remove_control( 'logistic_transport_post_settings_premium_features' );
//About Section
$wp_customize->add_section( 'cargo_transport_about_theme' , array(
'title' => esc_html__( 'About Theme', 'cargo-transport' ),
'priority' => 10,
) );
$wp_customize->add_setting('cargo_transport_demo_link',array(
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('cargo_transport_demo_link',array(
'type'=> 'hidden',
'description' => "
Theme Demo
Our premium version of Cargo Transport has unlimited sections with advanced control fields. Dedicated support and no limititation in any field.
View Demo",
'section'=> 'cargo_transport_about_theme'
));
$wp_customize->add_setting('cargo_transport_doc_link',array(
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('cargo_transport_doc_link',array(
'type'=> 'hidden',
'description' => "Theme Documentation
We have well prepared documentation that provides the general guidelines and suggestions needed for this theme.
View Documentation",
'section'=> 'cargo_transport_about_theme'
));
$wp_customize->add_setting('cargo_transport_forum_link',array(
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('cargo_transport_forum_link',array(
'type'=> 'hidden',
'description' => "Theme Support
Regarding any theme issue, we offer 24/7 support. You can get assistance from our support staff in resolving any problem. Please get in touch with us.
Support Forum",
'section'=> 'cargo_transport_about_theme'
));
$wp_customize->add_setting( 'cargo_transport_menu_settings_premium_features',array(
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('cargo_transport_menu_settings_premium_features', array(
'type'=> 'hidden',
'description' => "More Features in the Premium Version!
- Menu Background Colors
- Menu Item Fonts
- Responsive Menu Colors
- Header Search Icons Colors
- ... and Other Premium Features
Upgrade Now",
'section' => 'logistic_transport_header'
)
);
$wp_customize->add_setting( 'cargo_transport_post_settings_premium_features',array(
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('cargo_transport_post_settings_premium_features', array(
'type'=> 'hidden',
'description' => "More Features in the Premium Version!
- Section Heading Option
- Animated Elements Colors
- ... and Other Premium Features
Upgrade Now",
'section' => 'logistic_transport_blog_post'
)
);
}
add_action( 'customize_register', 'cargo_transport_customize_register', 11 );
require_once( ABSPATH . WPINC . '/class-wp-customize-section.php' );
class Cargo_Transport_Customize_Section_Pro extends WP_Customize_Section {
/**
* Outputs the Underscore.js template.
*
* @since 1.0.0
* @access public
* @return void
*/
protected function render_template() { ?>
{{ data.title }}
<# if ( data.pro_text && data.pro_url ) { #>
{{ data.pro_text }}
<# } #>
setup_actions();
}
return $instance;
}
/**
* Constructor method.
*
* @since 1.0.0
* @access private
* @return void
*/
private function __construct() {}
/**
* Sets up initial actions.
*
* @since 1.0.0
* @access private
* @return void
*/
private function setup_actions() {
// Register panels, sections, settings, controls, and partials.
add_action( 'customize_register', array( $this, 'sections' ) );
// Register scripts and styles for the controls.
add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 );
}
/**
* Sets up the customizer sections.
*
* @since 1.0.0
* @access public
* @param object $manager
* @return void
*/
public function sections( $manager ) {
// Register custom section types.
$manager->register_section_type( 'Cargo_Transport_Customize_Section_Pro' );
}
/**
* Loads theme customizer CSS.
*
* @since 1.0.0
* @access public
* @return void
*/
public function enqueue_control_scripts() {
wp_enqueue_style( 'cargo_transport-customize-controls', get_stylesheet_directory_uri() . '/css/customize-controls-child.css' );
}
}
// Doing this customizer thang!
Cargo_Transport_Customize::get_instance();
/* Theme Setup */
if ( ! function_exists( 'cargo_transport_setup' ) ) :
function cargo_transport_setup() {
$GLOBALS['content_width'] = apply_filters( 'cargo_transport_content_width', 640 );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'title-tag' );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'align-wide' );
add_theme_support( 'custom-logo', array(
'height' => 240,
'width' => 240,
'flex-height' => true,
) );
add_image_size('cargo-transport-homepage-thumb',240,145,true);
add_theme_support( 'custom-background', array(
'default-color' => 'f1f1f1'
) );
add_theme_support ('html5', array (
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
) );
add_theme_support('responsive-embeds');
add_theme_support( 'post-formats', array('image','video','gallery','audio',) );
add_editor_style( array( 'css/editor-style.css' ) );
}
endif;
add_action( 'after_setup_theme', 'cargo_transport_setup' );
function cargo_transport_widgets_init() {
register_sidebar( array(
'name' => __( 'Blog Sidebar', 'cargo-transport' ),
'description' => __( 'Appears on blog page sidebar', 'cargo-transport' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'cargo_transport_widgets_init' );
function cargo_transport_enqueue_comments_reply() {
if( is_singular() && comments_open() && ( get_option( 'thread_comments' ) == 1) ) {
wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true );
}
}
add_action( 'wp_enqueue_scripts', 'cargo_transport_enqueue_comments_reply' );
add_action( 'init', 'cargo_transport_remove_action');
function cargo_transport_remove_action() {
remove_action( 'admin_menu','logistic_transport_gettingstarted' );
remove_action( 'admin_notices','logistic_transport_activation_notice' );
}
// URL DEFINES
define('CARGO_TRANSPORT_SUPPORT',__('https://wordpress.org/support/theme/cargo-transport/','cargo-transport'));
define('CARGO_TRANSPORT_REVIEW',__('https://wordpress.org/support/theme/cargo-transport/reviews/','cargo-transport'));
define('CARGO_TRANSPORT_BUY_NOW',__('https://www.themescaliber.com/themes/cargo-wordpress-theme','cargo-transport'));
define('CARGO_TRANSPORT_LIVE_DEMO',__('https://www.themescaliber.com/cargo-transport-pro/','cargo-transport'));
define('CARGO_TRANSPORT_PRO_DOC',__('https://themescaliber.com/demo/doc/cargo-transport-pro/','cargo-transport'));
define('CARGO_TRANSPORT_CHILD_THEME',__('https://developer.wordpress.org/themes/advanced-topics/child-themes/','cargo-transport'));
define('CARGO_TRANSPORT_THEME_URL',__('https://www.themescaliber.com/themes/free-cargo-wordpress-theme/', 'cargo-transport'));
if ( ! defined( 'LOGISTIC_TRANSPORT_PRO_NAME' ) ) {
define( 'LOGISTIC_TRANSPORT_PRO_NAME', esc_html__( 'Cargo Pro Theme', 'cargo-transport' ));
}
if ( ! defined( 'LOGISTIC_TRANSPORT_PRO_URL' ) ) {
define( 'LOGISTIC_TRANSPORT_PRO_URL', esc_url('https://www.themescaliber.com/themes/cargo-wordpress-theme/'));
}
function cargo_transport_credit_link() {
echo "".esc_html__('Cargo WordPress Theme','cargo-transport')."";
}
/* Implement the get started page */
require get_theme_file_path() . '/inc/dashboard/getstart.php';
/* Block Pattern */
require get_theme_file_path() . '/block-patterns.php';