Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // wp_enqueue_style ইউস করে এক্সটারনাল স্টাইল কল করা ফাংসান পি এইচ পি এর মধ্যে।
- wp_enqueue_style( $handle, $src, $deps, $ver, $media );
- ১। $handle - এটা থাকতেই হবে। এটা যেকোনো নামেই হতে পারে যেমন 'arnab_style' এই নামের সাথে যে ফাইল কল করা হছে তার কোন মিল নেই।
- থাকলেও আসুবিধা নেই কাজ করে। তবে এটা ইউনিক হওয়াটা ভালো।
- Default: None
- ২। $src - এটাও থাকাতে হবে । এটা হছে যে ফাইল কল করা হছে তার সোর্স । এটা দুই ভাবে কল হতে পারে একটা প্লাগিন এর ক্ষেত্রে অন্যটা থিমের ক্ষেত্রে,
- Default: false
- প্লাগিন এর ক্ষেত্রে - plugins_url('test_plugin/js/main.css')
- থিমের ক্ষেত্রে - wp_enqueue_style( 'arnab_style', get_template_directory_uri() . '/css/style.css');
- এই দুটি থাকলেই হবে বাকিগুলি অপ্সানাল
- ৩। $deps -
- Default: array()
- ৪। $ver - এতা হল ভারসান
- Default: false
- ৫। $media - এটা হ্ল মিডিয়া কন ধরনের স্টাইল এড হবে যেমন 'media' , 'all'
- Default: 'all'
- একতা পুরো উদাহরণ - রিক্যারেড দিয়ে , থিমে কলের জন্য
- function theme_styles()
- {
- // Register the style like this for a theme:
- // (First the unique name for the style (custom-style) then the src,
- // then dependencies and ver no. and media type)
- wp_enqueue_style( 'arnab_style', get_template_directory_uri() . '/css/style.css');
- // enqueing:
- }
- add_action('wp_enqueue_scripts', 'theme_styles');
- function theme_styles()
- {
- // Register the style like this for a theme:
- // (First the unique name for the style (custom-style) then the src,
- // then dependencies and ver no. and media type)
- wp_register_style(get_template_directory_uri() . '/css/custom_style.css', array(), '20120208', 'all' );
- }
- add_action('wp_enqueue_scripts', 'theme_styles');
- // wp_register_script ইউস করে এক্সটারনাল javascripc কল করা ফাংসান পি এইচ পি এর মধ্যে।
- সবই ঠিক থাকবে সুধু লাস্ট স্ত্রিং বাদে
- লাস্ট টা হলে স্কিপ্ত টা কথায় লড হবে থিমের হেডারে না ফুটারে
- Default: false হেডারেই লড হবে
- থাকতেই হবে -
- function rrf_add_scripts() {
- wp_enqueue_script( 'arnab', get_template_directory_uri() . '/js/main.js');
- }
- add_action( 'wp_enqueue_scripts', 'rrf_add_scripts' );
- function rrf_add_scripts() {
- wp_register_script( 'bootstrapjs', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '420', TRUE );
- wp_enqueue_script( 'bootstrapjs' );
- }
- add_action( 'wp_enqueue_scripts', 'rrf_add_scripts' );
- // কন ফাইল functions.php তে কল করতে
- require_once ('inc/test_file.php');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement