Skip to content

Instantly share code, notes, and snippets.

View hmowais's full-sized avatar
🎯
Focusing

HM Owais hmowais

🎯
Focusing
  • Karachi, Pakistan
View GitHub Profile
@hmowais
hmowais / functions.php
Created December 18, 2024 15:41
UserBack Script
<?php
function add_userback_script() {
?>
<script>
window.Userback = window.Userback || {};
Userback.access_token = 'A-7VARVgBtpJtf80JEeZRR9LRpK';
// identify your logged-in users (optional)
Userback.user_data = {
id: "123456", // example data
@hmowais
hmowais / script.js
Created December 16, 2024 18:17
Counters for Webflow
// assign class counter on text span
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js'></script>
<script src='https://cdn.jsdelivr.net/jquery.counterup/1.0/jquery.counterup.min.js'></script>
<script>
$('.counter').counterUp({
delay: 10,
time: 1000
});
@hmowais
hmowais / functions.php
Last active December 11, 2024 22:26
Youtube Movie & TV Page Slider
<?php
// reference
// https://www.youtube.com/feed/storefront
function custom_swiper_slider_shortcode() {
ob_start();
// Fetch posts from the 'giveawayslider' custom post type
$args = [
@hmowais
hmowais / functions.php
Created December 11, 2024 18:19
Custom Filters CPT + Taxonomies [Shortcode]
<?php
/* Litigation Filters */
function multi_filter_litigation_cases_shortcode($atts) {
// Get filter values from URL parameters or defaults
$state = isset($_GET['state']) ? sanitize_text_field($_GET['state']) : '';
$issue = isset($_GET['issue']) ? sanitize_text_field($_GET['issue']) : '';
$case_status = isset($_GET['case_status']) ? sanitize_text_field($_GET['case_status']) : '';
@hmowais
hmowais / functions.php
Created December 11, 2024 15:32
CPT + Taxonomies Updated
<?php
<?php
/* Register CPT */
function cwptheme_post_type() {
$post_types_arr = array( 'Slider', 'Work', 'Staff', 'Map', 'Careers', 'Media', 'Events', 'Litigation', 'Advocacy', 'Guides' );
foreach( $post_types_arr as $post_type_a){
@hmowais
hmowais / custom.css
Created November 23, 2024 09:04
Latest News Ticker
/* Ticker */
@-webkit-keyframes ticker {
0% { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); visibility: visible; }
100% { -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); }
}
@keyframes ticker {
0% { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); visibility: visible; }
100% { -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); }
}
@hmowais
hmowais / functions.php
Created November 19, 2024 16:44
To add custom Price addon on woocommerce product
<?php
/**/
/**
* Adding Checkbox and Price Field in Product Admin Panel
*/
function custom_add_envelope_checkbox_and_price() {
echo '<div class="custom-envelop-checkbox">';
@hmowais
hmowais / index.html
Last active October 24, 2024 15:42
Light Mode / Dark Mode Toggle Slider
<label id="toggle_mode" class="switch" for="checkbox">
<input type="checkbox" id="checkbox" />
<div class="slider round"></div>
<span class="mode_text">Light Mode</span> <!-- Default text -->
</label>
<style>
html, body {
overflow-x: hidden;
transition: background-color 0.3s, color 0.3s; /* Smooth transition */
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="https://leafletjs.com/examples/choropleth/us-states.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
var map = L.map('map', {
center: [37.8, -96],
zoom: 5,
minZoom: 5,
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="https://leafletjs.com/examples/choropleth/us-states.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
var map = L.map('map', {
center: [37.8, -96],
zoom: 5,
minZoom: 5,