Skip to content

Instantly share code, notes, and snippets.

View akshansh1998's full-sized avatar

Ankush Anand akshansh1998

View GitHub Profile
@akshansh1998
akshansh1998 / disableBtn.html
Last active April 21, 2023 13:50
Disable button for a set time using JavaScript (WordPress or Non-WordPress)
<!-- HTML code is just for reference, you can modify the code and structure based on whatever you need, so elements are added to keep the javascript working on wordpress too, you can remove it and remove the children[0] too accordingly
## For WordPress, Use Elementor,
1. add a button widget,
2. add a id as ctaBtn to button widget
3. add a button text and append it with <span> Disabled Text </span> (replace the disabled text with whatever message you want to be there while button is disabled with the main button text
4. add a html widget and paste the script code from this gist there.
5. in script, you can change settings like timeout time (in milliseconds) and if you set another id or there is a different structure in html, you need to change css selector in query selector too.
-->
@akshansh1998
akshansh1998 / script.html
Created February 14, 2023 06:44
Make Slider out of anything for Elementor WordPres
<div class="swiper mySwiper">
<div class="swiper-wrapper" id="swiper-wrapper1"></div>
<div class="swiper-pagination"></div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
<style>
.swiper-pagination {
width: 100%;
@akshansh1998
akshansh1998 / gist:fc89496156549f8a1eb69f52618bd5cb
Last active January 4, 2022 16:15
WordPress Default .htaccess file with https redirect without any plugin
# Force HTTPS on all pages
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
@akshansh1998
akshansh1998 / Equal Height-Width JavaScript by Ankush.html
Created October 9, 2020 11:39
Code for Equalizing Columns + Centre Positioned Elements
<script>
//Center Width
function calcWidth(id) {
var h = document.getElementById(id).clientWidth;
var hh = h / 2;
document.getElementById(id).style.marginLeft = "-" + hh + "px";
}
window.onload = calcWidth("name");
@akshansh1998
akshansh1998 / Add Link to Copied Text Blogger
Last active October 15, 2023 08:23
Add Link to Copied Text Blogger - Read More at : yourwebsite.com or Copyright Note to the Person Copying it
@akshansh1998
akshansh1998 / Add Link to Copied Text
Last active October 13, 2018 15:33
Add Link to Copied Text from Your Website