Bird
0
0

Which is the correct syntax to include a template part named 'footer' with a slug 'custom'?

easy📝 Syntax Q3 of 15
Wordpress - Custom Theme Development
Which is the correct syntax to include a template part named 'footer' with a slug 'custom'?
Aget_template_part('footer', 'custom');
Bget_template_part('footer-custom');
Cinclude_template_part('footer', 'custom');
Dload_template_part('footer', 'custom');
Step-by-Step Solution
Solution:
  1. Step 1: Recall the function signature

    get_template_part() accepts two parameters: slug and optional name.
  2. Step 2: Match the correct syntax

    get_template_part('footer', 'custom'); uses the correct function and parameters. Others use wrong function names or wrong parameter format.
  3. Final Answer:

    get_template_part('footer', 'custom'); -> Option A
  4. Quick Check:

    Correct syntax = get_template_part(slug, name) [OK]
Quick Trick: Use get_template_part('slug', 'name') for specific parts [OK]
Common Mistakes:
  • Using wrong function names
  • Passing combined strings
  • Wrong parameter order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes