# Add custom font

You can add any fonts you want. However, in this guideline, we will guide you how to add font SofiaPro to the theme. &#x20;

When adding custom font, you need to make some changes first. Make sure you name all the folders follow the image below.&#x20;

*If you use other font, just change the name of the folder containing your font to the font name.*

![](/files/QhAJeWsEa8jzLwwK5FcO)

**NOTE**: The font name must have connect symbol "-"\
The white space like "Shapiro 25 Super Fly Text" will cause problem.

<figure><img src="/files/yWM8d3jQUBmMzvPdy667" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FKLZHjPaeHxa1ULBrM3P" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Steps:**

**Step 1:** Add font SofiaPro to child theme folder: **minimog-child/assets/fonts/sofia-pro**

**Step 2:** Add this following code to folder **minimog-child/functions.php**:
{% endhint %}

```
/**
* This is sample code to add custom font in Minimog
* This filter add your custom fonts to dropdown list using in Customize.
*
* @since Minimog 1.8.5
*/
add_filter('minimog/fonts/additional_fonts', 'minimog_child_add_custom_fonts');
function minimog_child_add_custom_fonts($additional_fonts) {
  // For eg: Custom Font name: SofiaPro.

  if( ! isset( $additional_fonts['SofiaPro'] )) {
     $additional_fonts['SofiaPro'] = 'SofiaPro, sans-serif';
  }

  return $additional_fonts;
}

/**
* This filter add your custom fonts to dropdown list using in Elementor Editor.
*/
add_filter( 'elementor/fonts/additional_fonts', 'add_custom_fonts', 10, 999 );
function add_custom_fonts( $fonts ) {
    $additional_fonts = [
        'SofiaPro' => 'minimog',
    ];
    return array_merge( $fonts, $additional_fonts );
}

/**
* This filter embed your font file to frontend.
*/
add_filter('minimog/custom_fonts/enqueue', 'minimog_child_enqueue_custom_fonts');
function minimog_child_enqueue_custom_fonts($font_family) {
  if ( strpos( $font_family, 'SofiaPro' ) !== false ) {
     /**
      * For eg: Font file locate at: minimog-child/assets/fonts/sofia-pro/font-sofia-pro.min.css
      */
     wp_enqueue_style( 'font-sofia-pro', get_stylesheet_directory_uri() . '/assets/fonts/sofia-pro/font-sofia-pro.min.css', null, null );
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://minimog-wp.gitbook.io/minimog-ecommerce-wordpress-theme/faqs/add-custom-font.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
