Skip to content

Instantly share code, notes, and snippets.

View YuvrajKhavad's full-sized avatar
👨‍💻
Simplifying Work at Z Index

Yuvraj Khavad YuvrajKhavad

👨‍💻
Simplifying Work at Z Index
View GitHub Profile
@shizhua
shizhua / like-it-enqueue.php
Last active September 25, 2023 12:48
Add a like button without a plugin in WordPress
add_action( 'wp_enqueue_scripts', 'pt_like_it_scripts' );
function pt_like_it_scripts() {
if( is_single() ) {
wp_enqueue_style( 'like-it', trailingslashit( plugin_dir_url( __FILE__ ) ).'css/like-it.css' );
if (!wp_script_is( 'jquery', 'enqueued' )) {
wp_enqueue_script( 'jquery' );// Comment this line if you theme has already loaded jQuery
}
wp_enqueue_script( 'like-it', trailingslashit( plugin_dir_url( __FILE__ ) ).'js/like-it.js', array('jquery'), '1.0', true );
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@rxaviers
rxaviers / gist:7360908
Last active May 5, 2024 15:52
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active December 15, 2023 09:11
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@chrisjlee
chrisjlee / drupal-views-share-global-text-field
Last active April 23, 2024 04:07
share url's for facebook, twitter, pinterest with just get variables
<ul>
<li class="share-text">Share this>/li>
<li class="share-tw"><a href="http://twitter.com/share?text=[title]"><span></span></a></li>
<li class="share-fb"><a href="http://www.facebook.com/sharer.php?u=/node/[nid]&p=[title]"><span></span></a></li>
<li class="share-pinterest"><a href="http://pinterest.com/pin/create/button/?url=/node/[nid]&description=[title]"><span></span></a></li>
</ul>
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@pkdavies
pkdavies / fixdb.php
Created June 21, 2011 13:17
Find and replace in MySQL - using PHP
<?php
// Find and replace facility for complete MySQL database
//
// Originally written by Mark Jackson @ MJDIGITAL
// Can be used by anyone - but give me a nod if you do!
// http://www.mjdigital.co.uk/blog
// http://www.mjdigital.co.uk/blog/search-and-replace-text-in-whole-mysql-database/
//
// PKDAVIES:
// Changed REGEX to LIKE