This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pre { | |
color: white; | |
border-left: 6px solid #bbb; | |
padding:5px 10px; | |
background: rgb(105,105,105); | |
font-size: 14px; | |
margin-right: 50px; | |
white-space:pre-wrap; | |
} | |
pre::selection { color: #696969; background: rgba(255, 255, 255, 0.996); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="enews-ext-3" class="enews-widget"> | |
<div class="enews"> | |
<div class="widget-wrap"> | |
<form id="subscribeenews-ext-3" name="submit" method="post" action-xhr="https://sangams.com.np/wpx/mailchimp-post.php" target="_top"> | |
<p>Get awesome content delivered straight to your inbox. </p> | |
<input type="email" name="email" placeholder="Enter your email address" required=""> | |
<input type="submit" value="Subscribe"> | |
<div submitting> | |
<template type="amp-mustache"> | |
Form submitting... Thank you for waiting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sets Access-Control-Allow-Origin for fonts | |
// this worker should be used in subdomain from where fonts are being loaded but not in main site | |
// eg. www.example.com & static.example.com | |
// use this worker script with static.example.com | |
let corsHeaders = { | |
"Access-Control-Allow-Origin" : "https://sangams.com.np", | |
} | |
addEventListener('fetch', event => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Stop CF edge from caching your site when specific wordpress cookies are present | |
// script found in https://www.mmaton.com/2018/07/02/cloudflare-cache-anonymous-requests/ | |
addEventListener('fetch', event => { | |
event.respondWith(noCacheOnCookie(event.request)) | |
}) | |
async function noCacheOnCookie(request) { | |
// Determine which group this request is in. | |
const cookie = request.headers.get('Cookie') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set page cache expiration time to 10 minutes | |
Header set Cache-Control "max-age=600, must-revalidate" "expr=%{REQUEST_URI} !~ m#^/wp-admin#" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//adding adsense ad unit inside the article | |
//Insert ads after second paragraph of single post content. | |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
function prefix_insert_post_ads( $content ) { | |
$ad_code1 = '<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | |
<!-- inContent --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//adding adsense ad unit inside the article | |
//Insert ads after second paragraph of single post content. | |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
function prefix_insert_post_ads( $content ) { | |
$ad_code1 = '<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//-------------------------------------------------------------- | |
//-------------------------------------------------------------- | |
//---------COPY CODE BELOW THIS LINE---------------------------- | |
//Adding adsense ad unit inside the article | |
//Insert ads after every third paragraph of single post content. |