Skip to content

Instantly share code, notes, and snippets.

Avatar
😇
Working actively on @designblocks

Haris Zulfiqar mharis

😇
Working actively on @designblocks
View GitHub Profile
@wpscholar
wpscholar / functions.php
Last active Mar 1, 2021
Enqueueing IE conditional stylesheets in WordPress the right way
View functions.php
<?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/
@bitfade
bitfade / gist:4555047
Last active Sep 25, 2019
WordPress - Remove empty p tags for custom shortcodes
View gist:4555047
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
// opening tag
@dovy
dovy / SMOF2Redux.php
Last active Dec 28, 2015
Add the following file somewhere within your theme. It will create a demo panel with your SMOF data as well as a SMOF2Redux Export menu item, to grab a functioning Redux configuration file.
View SMOF2Redux.php
<?php
if( !class_exists( 'SMOFtoRedux' ) ) {
class SMOFtoRedux {
public function __construct( ) {
add_action('init', array($this, 'addPanel'), 100);
add_action( 'admin_menu', array($this, 'addExportMenu') );