Skip to content

Instantly share code, notes, and snippets.

View jsakhil's full-sized avatar
🎯
Focusing

Js Akhil jsakhil

🎯
Focusing
View GitHub Profile
@jsakhil
jsakhil / test_wp_mail.php
Last active March 14, 2020 05:32 — forked from butlerblog/test_wp_mail.php
File for testing the wp_mail function
<?php
/**
* This file can be used to validate that the WordPress wp_mail() function is working.
* To use, change the email address in $to below, save, and upload to your WP root.
* Then browse to the file in your browser.
*
* For full discussion and instructions, see the associated post here:
* http://b.utler.co/9L
*
* Author: Chad Butler
var data = {
action: 'image_color',
id: 1234
}
//jQuery
jQuery.ajax(
{
url: " http://domain.com/wp-admin/admin-ajax.php",
type: "POST",
@jsakhil
jsakhil / carousel-indicators.js
Created September 28, 2017 05:34 — forked from dvsqz/carousel-indicators.js
Auto-generate Bootstrap Carousel Indicator HTML
@jsakhil
jsakhil / hideelement.js
Created September 28, 2017 07:54
Trick to Hide Element in source code when debugger is opened
var currentInnerHtml;
var element = new Image();
var elementWithHiddenContent = document.querySelector("#elementtohide");
var innerHtml = elementWithHiddenContent.innerHTML;
element.__defineGetter__("id", function() {
currentInnerHtml = "";
});
@jsakhil
jsakhil / return-to-top.css
Created October 6, 2017 11:22
Simple Return to Top,
/* Return To Top */
#return-to-top {
position: fixed;
bottom: 20px;
right: 20px;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.7);
width: 50px;
height: 50px;
@jsakhil
jsakhil / recaptcha.html
Created November 3, 2017 06:50
Multiple reCAPTCHA
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
<div class="form-group">
<div class="g-recaptcha" id="optional-id"></div>
</div>
<script type="text/javascript" charset="utf-8">
var onloadCallback = function() {
var recaptchas = document.querySelectorAll('div[class=g-recaptcha]');
@jsakhil
jsakhil / tab_slider_fix.js
Last active August 19, 2020 11:01
Fix for slick slider when added multiple slider in tab content
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
$('.slider').slick('setPosition');
});
—– BEGIN LICENSE —–
TwitterInc
200 User License
EA7E-890007
1D77F72E 390CDD93 4DCBA022 FAF60790
61AA12C0 A37081C5 D0316412 4584D136
94D7F7D4 95BC8C1C 527DA828 560BB037
D1EDDD8C AE7B379F 50C9D69D B35179EF
2FE898C4 8E4277A8 555CE714 E1FB0E43
D5D52613 C3D12E98 BC49967F 7652EED2
@jsakhil
jsakhil / function.php
Last active June 19, 2019 06:31
WordPress Post Views Counter Without Any Plugin
<?php
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return "0 View";
}
return $count.' Views';
@jsakhil
jsakhil / lang_switch.html
Last active June 19, 2019 06:29
qTranslate WordPress Plugin Custom Language Switch
<div class="language_switch" tabindex="0">
<span class="current" data-value="en">EN</span>
<ul class="list">
<li data-value="en" class="option selected">EN</li>
<li data-value="fr" class="option">FR</li>
<li data-value="de" class="option">DE</li>
</ul>
</div>