support SVG on header

support SVG on header

This topic contains 2 replies, has 2 voices, and was last updated by  iceable 1 year, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19122
    support SVG on header

    Pascal
    Participant

    Here the change what I made to support SVG on Header.

    in settings.php

        $settings_options[] = array(
            'name' => __('Site Title', 'icefit'),
            'desc' => __('Choose "display title" if you want to use a text-based title instead of an uploaded logo.',
                         'icefit'),
            'id' => 'header_title',
            'type' => 'radio',
            'default' => 'Display Title',
            'values' => array(
                array('value' => 'Use Logo', 'display' => __('Use Logo', 'icefit')),
                array('value' => 'Display Title', 'display' => __('Display Title', 'icefit')),
               array('value' => 'Use SVG', 'display' => __('Use SVG', 'icefit'))
            ),
        );

    in the header.php

                            if ($icefit_options['header_title'] == 'Display Title'
                                || $logo_url == ""
                                || "null.png" == substr($logo_url, -8)
                            ):
                                ?>
                                <h1 class="site-title"><?php echo bloginfo('name'); ?></h1>
                                <?php
                            elseif ($icefit_options['header_title'] == 'Use SVG'):
                                ?>
                                <img style="height:80px; width: auto" src="<?php echo esc_url($logo_url); ?>#svgView(preserveAspectRatio(none))" />
                                <?php
                            else:
                                ?><img src="<?php echo esc_url($logo_url); ?>" alt="<?php echo bloginfo('name'); ?>"><?php
                            endif;

    changing the Language files: blackoot-pro.pot and en_US.po

    • This topic was modified 1 year, 2 months ago by  Pascal.
    #19124
    Reply to: support SVG on header

    Pascal
    Participant

    … and maybe add some fields for height and width. Will work on that later.

    #19138
    Reply to: support SVG on header

    iceable
    Keymaster
    Support
    Happy with my help?
    Buy me a beer!

    Hi, this looks pretty good!

    We’ll review it with some tests to make sure it covers various use cases and will definitely consider adding this option (along with width/height fields as mentioned) in a future update.

    Thank you very much for sharing your code!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘support SVG on header’ is closed to new replies.


PayPal Verified
Secured by PayPal
Secure Credit Card payments powered by Stripe
SiteLock