AI Assistant

Images and Fonts

Images

Store theme image assets in:

src/assets/img/

These files are automatically copied to the build directory and included in the production export.

Keep only essential assets (icons, logos, SVGs) in your theme directory. Use the WordPress Media Library for content images like photos and illustrations. This keeps the theme lightweight and faster to deploy.

To reference an image in your PHP templates:

<img src="<?php echo get_template_directory_uri(); ?>/img/logo.svg" alt="Logo">

Fonts

Store custom font files in:

src/assets/fonts/

Load them with @font-face in your CSS:

@font-face {
  font-family: "CustomFont";
  src: url("../fonts/CustomFont.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

For Google Fonts or other externally hosted fonts, enqueue them in your theme's functions.php instead of bundling the files locally.