• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Centric Pro Header Image

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Centric Pro Header Image

This topic is: not resolved

Tagged: centric pro, header image, SVG

  • This topic has 3 replies, 3 voices, and was last updated 9 years ago by bluebird.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 2, 2016 at 1:33 pm #196935
    bluebird
    Member

    Hi all,

    I was wondering if someone could give me an idea on how add/upload an SVG image to the header. I have tried adding custom functions via functions.php in order to enable the uploading of SVG images, but it does not work. I have also tried using a plugin to no avail.

    Here are the functions that I tried to use:

    function cc_mime_types($mimes) {
      $mimes['svg'] = 'image/svg+xml';
      return $mimes;
    }
    add_filter('upload_mimes', 'cc_mime_types');
    
    function fix_svg_thumb_display() {
      echo '
        td.media-icon img[src$=".svg"], img[src$=".svg"].attachment-post-thumbnail {
          width: 100% !important;
          height: auto !important;
        }
      ';
    }
    add_action('admin_head', 'fix_svg_thumb_display');

    Thanks in advance to anyone who can assist!

    December 3, 2016 at 3:06 pm #196956
    emasai
    Participant

    You cannot upload svg files through the uploader, you need to add them via FTP to the images folder and call them from there.


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

    December 4, 2016 at 6:36 am #196968
    Brad Dalton
    Participant

    Untested but try this code

    There are also 3 other ways to use SVG in the header.


    Tutorials for StudioPress Themes.

    December 4, 2016 at 1:00 pm #196999
    bluebird
    Member

    Hi Emasai and Brad,

    Thanks for getting back to me. I tried to add the image by calling it from my images folder like so:

    add_theme_support( 'custom-header', array(
        'default-image'   => get_stylesheet_directory_uri() . '/images/logo.svg',
        'width'           => 100,
        'height'          => 100,
        'header-selector' => '.site-title a',
        'header-text'     => false
    ) );

    ...and it did not work...

    I also tried to add the image via some javascript:

    var image = document.createElement("img");
          
          var imageParent = document.querySelector("a");
          var searchPic = new Image(100,100);
           searchPic.src = "images/logo.svg";
          // image.id = "Id";
          // image.className = "class";
          image.src = searchPic.src;
          imageParent.innerHTML = "";
          imageParent.appendChild(image);

    With this code the link still works, but the image (even though I can see it referenced in the console) does not appear as it should.

    I also tried a plugin to no avail. I also tried the code that is referenced the CSS Tricks link above and that didn't work either.

    Sigh....... I'm beginning to think that it's just not possible. Hopefully I'm wrong.

    Thanks again:-)

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble