Skip to content

Instantly share code, notes, and snippets.

View sureshHARDIYA's full-sized avatar
🎯
Learning by burning ...

Suresh KUMAR Mukhiya sureshHARDIYA

🎯
Learning by burning ...
View GitHub Profile
@sureshHARDIYA
sureshHARDIYA / retreieveFunctions.php
Created October 6, 2017 13:51
Retrieving custom fields
<?php
<?php
// Display Custom Field Value
echo get_post_meta( $post->ID, 'my-field-slug', true );
// You can also use
echo get_post_meta( get_the_ID(), 'my-field-slug', true );
?>
@sureshHARDIYA
sureshHARDIYA / adsense.js
Last active January 15, 2024 06:25
Create Google Adsense ad using JavaScript
var adUnit = document.getElementsByClassName("section-below-title")[0];
var parentElement = adUnit.childNodes[0];
// Create script element
var script = document.createElement('script');
script.async = true;
script.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
parentElement.appendChild(script);
// Create INS element