Created
December 24, 2022 14:21
-
-
Save humayunahmed8/92c08f12bc36d73d1957adf41575b149 to your computer and use it in GitHub Desktop.
WP enqueue scipts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mydeals_styles() { | |
if( is_page(['all-deals'])) { | |
wp_enqueue_style( 'bootstrap-test', get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(), '5.3.11', false ); | |
} | |
} | |
add_action('wp_enqueue_scripts', 'mydeals_styles'); | |
// function mydeals_script() { | |
// wp_enqueue_script( 'bootstrap-js-test', get_template_directory_uri() . '/assets/css/bootstrap.min.js', array(), '1.0', true ); | |
// } | |
// add_action('wp_enqueue_scripts', 'mydeals_script'); | |
// function mydeals_script() { | |
// $theme = wp_get_theme(); | |
// wp_register_style( 'bootstrap-js-test', get_theme_file_uri('assets/css/bootstrap.min.js'), array(), $theme->get( 'Version' ) ); | |
// } | |
// add_action('wp_enqueue_scripts', 'mydeals_script'); | |
function wpdocs_enqueue_custom_style() { | |
$theme = wp_get_theme(); | |
wp_register_style( | |
'wpdocs-style', | |
get_theme_file_uri( 'css/style.css' ), | |
array(), | |
$theme->get( 'Version' ) | |
); | |
wp_enqueue_style( 'wpdocs-style' ); | |
$custom_css = ".navbar-nav ul li { list-style: none; }"; | |
wp_add_inline_style( 'wpdocs-style', $custom_css ); | |
} | |
add_action( 'wp_enqueue_scripts', 'wpdocs_enqueue_custom_style' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment