svg-sprite --si --stack icons/*.svg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Will minify HTML | |
*/ | |
ob_start(function($b){return preg_replace(['/\>[^\S ]+/s','/[^\S ]+\</s','/(\s)+/s'],['>','<','\\1'],$b);}); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('DISALLOW_FILE_EDIT', true); | |
define('WP_DEBUG', true); | |
define('WP_AUTO_UPDATE_CORE', false); | |
define('WP_POST_REVISIONS', false ); | |
if ( WP_DEBUG ) { | |
define( 'WP_DEBUG_LOG', true ); //Log errors in a file | |
define( 'WP_DEBUG_DISPLAY', false ); //blocks message display on the website | |
define('SAVEQUERIES', true); //Save MySql queries in the global var $wpdb->queries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyConfig extends Config | |
{ | |
public function __construct() | |
{ | |
$faker = Faker\Factory::create('en_GB'); | |
$this->post_type = 'post'; | |
$this->post_title = $faker->name(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: My Cronjobs | |
*/ | |
defined('ABSPATH') or die; | |
/** | |
* Add Cron when the theme is activated | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Bwap Shortcodes | |
Description: Add shortcodes you write | |
Version: 0.1 | |
Author: Bwap | |
*/ | |
defined( 'ABSPATH' ) or die; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Make sure that the viewBox attributes are using the same values. | |
xlink:href should refer to the id of the <svg> and have a # sign before it. | |
--> | |
<div style="display:none"> | |
<svg id="mySVG" width="50" height="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">...</svg> | |
</div> | |
<svg viewBox="0 0 50 50"><use xlink:href="#mySVG"></use></svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Responsive Youtube embeds. | |
* | |
* Adds bootstrap responsive embed markup and classes and avoid showing related | |
* videos at the end of the videos. | |
*/ | |
add_filter( 'embed_oembed_html', function( $html, $url, $attr, $post_ID ) { | |
if ( false !== stripos( $html, '<iframe ' ) && false !== stripos( $html, '.youtube.com/embed' ) ) { | |
//don't show related videos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Cleaning Smartcrawl metabox | |
*/ | |
add_action('admin_head', function() { | |
echo ' | |
<style> | |
#wds-wds-meta-box .widefat tr{display:none} | |
#wds-wds-meta-box .widefat tr:nth-child(1), | |
#wds-wds-meta-box .widefat tr:nth-child(2), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add admin dashboard widgets for each .md file found in theme root. | |
* | |
* reads the *.md markdown files at the root of the theme and display a widget for each .md in the admin dashboard | |
* <!> Requires the class Parsedown https://github.com/erusev/parsedown | |
* <!> includes classes/Parsedown.php | |
*/ | |
add_action('wp_dashboard_setup', function(){ | |
$themeDir = get_template_directory(); |
OlderNewer