Site logo

Archived topic

Local Font URL

36 replies · Started by Michael on March 28, 2020

Viewing posts 31–37 of 37

Hi Tom, I'm looking now at ditching the code snippets plugin as you suggested, but wanted to just check if I can literally copy and paste each one into the functions.php or if more is required?

The formatting of some of the snippets seems to be a bit different (and my knowledge of php is not good) eg

add_action( 'wp_head', function () { ?>
 //Code
<?php } );

And then snippets like:

add_filter( 'generate_logo_output', function() {
    return sprintf(
        '<div class="site-logo">
            <a href="%1$s" title="Title" rel="home">

            </a>
        </div>',
        esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
        esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
    );
} );

Do I need to encapsulate all the snippets within php start and end tags (if that's the word)? Like <?php then add all snippets and end with <?php

Thank you very much for your help.

Michael.

You can just move those over as they are.

Your functions.php file will start with a <?php tag, and it never needs to be closed (?>).

Awesome Tom, thank you very much

You're welcome :)

And I'm attempting to add webp images to the footer but for some reason customizer is stripping the the additional html:

<div class="featured-in">
    <p>As Featured In:</p>
    <picture>
        <source srcset="https://reclaimdesign.org/wp-content/uploads/as-featured-in-trim.webp" type="image/webp">
        <source srcset="https://reclaimdesign.org/wp-content/uploads/as-featured-in-trim.jpg" type="image/jpeg"> 
        <img src="https://reclaimdesign.org/wp-content/uploads/as-featured-in-trim.jpg" alt="Publications we have been featured in | Reclaim Design" title="Reclaim Design As Featured In: Condé Nast | SA Garden & Home | House & Leisure | SA Homeowner | Elle Decor | Home | VISI" width="960" height="55" />
    </picture>
</div>

After saving in customizer becomes:

https://www.dropbox.com/s/0qf9r5hf4m1k9t1/customizer-stripping-picture-webp.jpg?dl=0

Thank you for your help!

Any chance you can open a new topic as this one is resolved?

Thanks! :)

This archived topic is closed to new replies.