[Resolved] Local Font URL

Home Forums Support [Resolved] Local Font URL

Home Forums Support Local Font URL

Viewing 7 posts - 31 through 37 (of 37 total)
  • Author
    Posts
  • #1322653
    Michael

    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.

    #1322789
    Tom
    Lead Developer
    Lead Developer

    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 (?>).

    #1323536
    Michael

    Awesome Tom, thank you very much

    #1323947
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #1323983
    Michael

    Hi Tom,

    Please can I ask if there is a snippet to achieve this?

    https://www.dropbox.com/s/76rh2s1jwdak48a/content-best-practice-score.jpg?dl=0

    These are the links on the featured images on my blog page.

    Thank you for your help!

    Michael.

    #1324050
    Michael

    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!

    #1324334
    Tom
    Lead Developer
    Lead Developer

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

    Thanks! 🙂

Viewing 7 posts - 31 through 37 (of 37 total)
  • You must be logged in to reply to this topic.