Themes Flashcards

1
Q

Q: What is a WordPress theme?

A

A: A collection of files that define the design and layout of a WordPress site.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q: Where are WordPress themes stored?

A

A: In the wp-content/themes directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q: What is the minimum requirement for a WordPress theme?

A

A: An index.php file and a style.css file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q: What is the purpose of the style.css file in a theme?

A

A: To define the theme’s metadata and styling rules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q: What is the purpose of the index.php file in a theme?

A

A: It serves as the default fallback template in the WordPress template hierarchy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Q: What is the Template Hierarchy?

A

A: A system WordPress uses to decide which template file to use for a given page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Q: What template file is used for single blog posts?

A

A: single.php.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q: What template file is used for pages?

A

A: page.php.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Q: What template file is used for the homepage?

A

A: home.php or front-page.php.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Q: What is the fallback template file in the Template Hierarchy?

A

A: index.php.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Q: What is a child theme?

A

A: A theme that inherits the functionality of another theme (the parent theme).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Q: How do you enqueue stylesheets in a theme?

A

A: Using the wp_enqueue_style() function in the functions.php file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Q: How do you enqueue scripts in a theme?

A

A: Using the wp_enqueue_script() function in the functions.php file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Q: What is the purpose of the functions.php file in a theme?

A

A: To add custom functionality to a WordPress theme.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Q: What is the purpose of the header.php file in a theme?

A

A: To contain the HTML and PHP code for the site’s header section.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Q: What is the WordPress Customizer?

A

A: A tool that allows users to customise their site’s appearance in real time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Q: What is the purpose of the customize_register hook?

A

A: To add custom options to the WordPress Customizer.

18
Q

Q: How can you add custom menus to a theme?

A

A: By using the register_nav_menus() function in the functions.php file.

19
Q

Q: How can you add widget areas to a theme?

A

A: By using the register_sidebar() function in the functions.php file.

20
Q

Q: What is the purpose of the footer.php file in a theme?

A

A: To contain the HTML and PHP code for the site’s footer section.

21
Q

Q: What is a template part in WordPress?

A

A: A reusable section of code included using the get_template_part() function.

22
Q

Q: What is the purpose of the_title() in a template?

A

A: To display the title of a post or page.

23
Q

Q: What is the purpose of the_content() in a template?

A

A: To display the main content of a post or page.

24
Q

Q: How can you display the featured image in a theme?

A

A: Using the the_post_thumbnail() function.

25
Q

Q: What is the purpose of the loop in WordPress themes?

A

A: To retrieve and display posts based on the query.

26
Q

Q: What is the purpose of the archive.php file?

A

A: To display archive pages for categories, tags, or custom taxonomies.

27
Q

Q: What is the purpose of the search.php file?

A

A: To display the search results page.

28
Q

Q: What is the purpose of the 404.php file?

A

A: To display a custom error page for non-existent URLs.

29
Q

Q: What is the purpose of the single.php file?

A

A: To display individual posts.

30
Q

Q: What is the purpose of the page.php file?

A

A: To display individual pages.

31
Q

Q: Why should you enqueue styles and scripts instead of hardcoding them?

A

A: To avoid conflicts and ensure compatibility with other plugins and themes.

32
Q

Q: Why is it important to use get_template_directory_uri() instead of hardcoding URLs?

A

A: To make the theme portable and avoid issues when moving the site.

33
Q

Q: What are theme slugs, and why are they important?

A

A: Unique identifiers for themes, used for consistent naming conventions.

34
Q

Q: Why should you use child themes for customisation?

A

A: To ensure updates to the parent theme do not overwrite custom changes.

35
Q

Q: What is the purpose of add_theme_support()?

A

A: To enable specific features in a theme, such as post thumbnails or custom logos.

36
Q

Q: What is a full-site editing (FSE) theme?

A

A: A theme that uses the block editor to control all parts of the site, including headers and footers.

37
Q

Q: What is the template-parts directory used for?

A

A: To store reusable template parts for a theme.

38
Q

Q: How can you override parent theme templates in a child theme?

A

A: By copying the parent theme file to the child theme directory and editing it.

39
Q

Q: What is the theme.json file used for?

A

A: To define global styles and settings for block-based themes.

40
Q

Q: What is a starter theme?

A

A: A minimal theme used as a base for custom theme development, such as Underscores or Sage.