Skip to content

Instantly share code, notes, and snippets.

View pelukho's full-sized avatar
🏠
Working from home

pelukho

🏠
Working from home
View GitHub Profile
<?php
function remove_noscript_from_footer_autoptimize( $html ) {
return preg_replace('~<noscript>(.*)</noscript>~', '', $html);
}
add_filter('autoptimize_filter_imgopt_lazyload_cssoutput', 'remove_noscript_from_footer_autoptimize');
@pelukho
pelukho / script.js
Created April 16, 2021 14:51
Ajax sending data for wordpress
// document ready function
let ready = callback => {
if (document.readyState !== "loading") {
callback();
} else {
document.addEventListener("DOMContentLoaded", callback);
}
}
async function postData(url = '', data = {}) {
function dtrm_add_article_microdata() {
if ( 'post' !== get_post_type() && ! is_singular() ) {
return;
}
$current_post_id = get_queried_object_id();
?>
<script type=application/ld+json>
{
"@context" : "http://schema.org",