Skip to content

Instantly share code, notes, and snippets.

View BryanBarrera's full-sized avatar

Bryan Barrera BryanBarrera

View GitHub Profile
@djrmom
djrmom / custom-hooks.php
Created February 8, 2021 14:56
facetwp GDPR Cookie Consent compatiblity
<?php
/** ignore query added by GDPR Cookie Consent **/
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
if ( 'cookielawinfo' == $query->get( 'post_type' ) ) {
$is_main_query = false;
}
return $is_main_query;
}, 10, 2 );
@rigwild
rigwild / selfbot.js
Last active April 9, 2022 20:37
This has moved to https://github.com/rigwild/discord-self-bot-console --- A simple Discord Self-bot using console
// Due to some interest, I created a proper repo.
// Check it out! :)
// https://github.com/rigwild/discord-self-bot-console
@anschaef
anschaef / bootstrap-4-sass-mixins-cheat-sheet.scss
Last active April 12, 2024 08:49
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
/*
// ########################################################################## */
// New cheat sheet for Bootstrap 5:
@phucdohong96
phucdohong96 / shortcode_post_object.php
Created August 24, 2017 04:21
Shortcode Sample ACF Post Object & ACF Repeater
<?php
function shortcode_post_object_function() {
ob_start();
$count = 0;
//Get field
$post_objects = get_field ('post_objects');
if (!empty($post_objects)) {
foreach ($post_objects as $post_object) {
$id = $post_object->ID;
@nr1q
nr1q / qtranslate_cleanup.sql
Created August 8, 2017 22:55 — forked from frnhr/qtranslate_cleanup.sql
clean database after qTranslate uninstall
# QTRANSLATE CLEANUP QUERIES
# create temp column to separate post content on <!--more--> tag to simplify queries
ALTER TABLE `wp_posts` ADD `tmp_excerpt` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
# split content
## fill `tmp_exceprt` column
UPDATE wp_posts SET tmp_excerpt =
@iamravenous
iamravenous / jquery.smooth-scroll-pageload.js
Last active April 23, 2024 09:05
Smooth scrolling on page load if URL have a hash
/*
* Smooth Scroll on Pageload
* Smooth scrolling on page load if URL have a hash
* Author: Franco Moya - @iamravenous
*/
if (window.location.hash) {
var hash = window.location.hash;
if ($(hash).length) {
@guillaumepiot
guillaumepiot / gist:5442196
Last active December 16, 2015 13:29
SOCIAL - Twitter share
// We bind a new event to our link
$('a.tweet').click(function(e){
//We tell our browser not to follow that link
e.preventDefault();
//We get the URL of the link
var loc = $(this).attr('href');
//We get the title of the link
@krogsgard
krogsgard / custom-field-advanced-body-class.php
Created June 20, 2012 16:57
add a body class based on a post's custom field value
<?php
// check for '_my_custom_field' meta key on pages and page parents and add a body class if meta value equals 'some-value'
add_filter('body_class','krogs_custom_field_body_class');
function krogs_custom_field_body_class( $classes ) {
global $post;