Wordpress - Theme Structure and BasicsWhich of the following is the correct syntax to enqueue a style named 'custom-style' located in the theme's 'css' folder?Aenqueue_style('custom-style', '/css/custom-style.css');Bwp_enqueue_style('custom-style', get_template_directory_uri() . '/css/custom-style.css');Cwp_enqueue_style('custom-style', '/css/custom-style.css');Dwp_add_style('custom-style', get_stylesheet_directory() . '/css/custom-style.css');Check Answer
Step-by-Step SolutionSolution:Step 1: Use the correct function and pathUse 'wp_enqueue_style' with 'get_template_directory_uri()' to get the theme URL.Step 2: Check the syntax correctnesswp_enqueue_style('custom-style', get_template_directory_uri() . '/css/custom-style.css'); correctly concatenates the URI with the CSS file path.Final Answer:wp_enqueue_style('custom-style', get_template_directory_uri() . '/css/custom-style.css'); -> Option BQuick Check:Correct enqueue syntax = wp_enqueue_style('custom-style', get_template_directory_uri() . '/css/custom-style.css'); [OK]Quick Trick: Use get_template_directory_uri() for theme URLs [OK]Common Mistakes:Using wrong function namesUsing file system path instead of URLMissing concatenation operator
Master "Theme Structure and Basics" in Wordpress9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More Wordpress Quizzes Content Management - Media library management - Quiz 4medium Content Management - Media library management - Quiz 9hard Content Management - Gutenberg block editor basics - Quiz 1easy Content Management - Gutenberg block editor basics - Quiz 12easy Plugins and Extensibility - SEO plugins (Yoast, RankMath) - Quiz 15hard Plugins and Extensibility - Essential plugin categories - Quiz 4medium Themes and Appearance - Full Site Editing basics - Quiz 12easy Themes and Appearance - Why themes control presentation - Quiz 12easy WordPress Basics and Architecture - WordPress.org vs WordPress.com - Quiz 15hard WordPress Settings and Configuration - User roles and permissions - Quiz 10hard