• Resolved acheetahpurr

    (@acheetahpurr)


    Hi
    I just have added this code into my functions.php file in mobile theme and it works, I would like to add it for my amp version, do you think it’s possible ?

    // Preload Newspaper fonts for mobile theme
    
    function dns_prefetch_mobile() {
    	
    	echo "<link href='https://lowtechnation.com/wp-content/plugins/td-composer/mobile/images/icons/mobile-theme.woff?9' rel='preload' as='font' type='font/woff' crossorigin>";
    }
    add_action( 'wp_head', 'dns_prefetch_mobile', 0 );

    Thank you

    Kind regards

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter acheetahpurr

    (@acheetahpurr)

    Can someone edit my post to delete my url in the code ? My forum id is related to my wordpress ID, it’s about security. The content of this topic can be found on google.

    Thank you

    • This reply was modified 4 years, 5 months ago by acheetahpurr.
    • This reply was modified 4 years, 5 months ago by acheetahpurr.
    Plugin Author Weston Ruter

    (@westonruter)

    I cannot change the contents of your topic. I did report it to a moderator, however.

    In regards to adding preload links to AMP pages, that should work just fine as long as the template you’re using for AMP includes wp_head(), as it should. I don’t know how your AMP templates are built.

    If not using the legacy Reader mode (as you aren’t), then you should be able to use standard WordPress hooks to add markup to AMP pages.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I’m sorry but no. Unless it is an extreme case, posts and replies are not edited here.

    Forum topics will only be edited or deleted if they represent a valid legal, security, or safety concern. There’s no security-related problem with your post.

    See https://www.ads-software.com/support/guidelines/#deleting-editing-posts and https://www.ads-software.com/about/privacy/

    Thread Starter acheetahpurr

    (@acheetahpurr)

    @sterndata

    Hi,

    this topic is represent security concern, because my wordpress id is my wordpress forums id, I don’t want anyone from google and who know my site, to be able to to get my wordpress ID. So please edit my url link, and change for :

    // Preload Newspaper fonts for mobile theme
    
    function dns_prefetch_mobile() {
    	
    	echo "<link href='https://MYDOMAIN.com/wp-content/plugins/td-composer/mobile/images/icons/mobile-theme.woff?9' rel='preload' as='font' type='font/woff' crossorigin>";
    }
    add_action( 'wp_head', 'dns_prefetch_mobile', 0 );

    Thank you

    • This reply was modified 4 years, 5 months ago by acheetahpurr.
    • This reply was modified 4 years, 5 months ago by acheetahpurr.
    • This reply was modified 4 years, 5 months ago by acheetahpurr.
    Thread Starter acheetahpurr

    (@acheetahpurr)

    Hi @westonruter

    Thank you for your help, I’m using Transitional mode as suggested, tagDiv Mobile Theme plugin and Official AMP for WP plugin. I don’t know how amp templates are built because it’s automatic. The only thing I know is my mobile version is faster than my amp version, so I’m just to make my amp version faster.

    https://developers.google.com/speed/pagespeed/insights/?hl=fr&url=https%3A%2F%2Flowtechnation.com%2F%3Famp&tab=mobile

    @acheetahpurr thanks for your reply! TagDiv Newspaper Theme support would be the best resource then to understand how it is using the AMP plugin and to make the customization you desire in their templates.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to Preload fonts ?’ is closed to new replies.