Skip to content

Instantly share code, notes, and snippets.

View lizardking8610's full-sized avatar

Robert lizardking8610

View GitHub Profile
/**
* Get the host of the this script. The host will be used for posting the data.
*/
var getHost = function () {
var scripts = document.getElementsByTagName("script");
var i;
for (i = 0; i < scripts.length; i++) {
var urlAttribute = scripts[i].attributes.getNamedItem("src");
if (urlAttribute) {
var url = urlAttribute.nodeValue;
@lizardking8610
lizardking8610 / hidewidget.php
Created May 24, 2019 17:39
hide specific elementor widget
If you just want to hide the widget form showing in the panel, you can simply set the widget's show_in_panel parameter to false ex:
add_filter( 'elementor/editor/localize_settings', function( $settings ) {
$settings['widgets']['heading']['show_in_panel'] = false;
return $settings;
} );
@lizardking8610
lizardking8610 / hide.php
Created May 24, 2019 17:32
Hide Elementor Widgets
global $elementor_widget_blacklist;
$elementor_widget_blacklist = [
,'common'
,'heading'
,'image'
,'text-editor'
,'video'
,'button'
,'divider'
@lizardking8610
lizardking8610 / modernizr_enqueue
Created May 23, 2019 21:36 — forked from zslabs/modernizr_enqueue
Enqueue Modernizr before all other scripts
function basey_scripts_header() {
wp_enqueue_script('modernizr', get_template_directory_uri() . '/js/modernizr.foundation.js', '', null, false);
}
add_action('template_redirect','basey_scripts_header', 8);
@lizardking8610
lizardking8610 / functions.php
Created May 23, 2019 20:45 — forked from wpscholar/functions.php
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
" Make IE Better Compatible "
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
======================================================
IE6 Only
==================
_selector {...}
add_action( 'wp_enqueue_scripts', 'generate_remove_fontawesome', 100 );
function generate_remove_fontawesome() {
wp_dequeue_style( 'fontawesome' );
}
@lizardking8610
lizardking8610 / acf-field-group-schema.json
Created May 9, 2019 22:12 — forked from friartuck6000/acf-field-group-schema.json
JSON schema for Advanced Custom Fields (ACF) field groups
{
"$schema": "http://json-schema.org/schema#",
"id": "http://advancedcustomfields.com/json-schema/field_group",
"type": "object",
"definitions": {
"empty": {
"type": "string",
"maxLength": 0
},
"intOrEmpty": {
<?php
add_action( 'genesis_meta', 'agency_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
* Link http://wpsites.net/web-design/add-widget-home-php-genesis/
*/
function agency_home_genesis_meta() {
//This code gets added to the end of the home.php file before the genesis() tag.
function agency_home_full_helper() {
if ( is_active_sidebar( 'full-content' ) ) {
echo '<div id="full-content">';
dynamic_sidebar( 'full-content' );
echo '</div><!-- end #full-content -->';
}
}