Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Knighton mrkdevelopment

View GitHub Profile
@mrkdevelopment
mrkdevelopment / zip_no_ds_store
Created Jan 26, 2012
To ZIP files and no include .DS_store
View zip_no_ds_store
zip -r archive.zip * -x "*.DS_Store"
View Media Query for Divi Full Width
@media (max-width: 1200px) {
.et_boxed_layout #page-container,
.et_fixed_nav.et_boxed_layout #page-container #top-header,
.et_fixed_nav.et_boxed_layout #page-container #main-header{
width:100%;
}
}
@mrkdevelopment
mrkdevelopment / Create Tar
Created Feb 10, 2017
Use this for migrations and downloads of remote WordPress sites.
View Create Tar
//tar files
tar -zcvf backup.tar.gz *
@mrkdevelopment
mrkdevelopment / css snippet
Last active Apr 22, 2017
DiviFramework Breadcrumb CSS
View css snippet
#breadcrumbs span,
#breadcrumbs span a{
color:#fff;
font-weight: bold;
}
#breadcrumbs span:first-child{
background:#009DDC;
padding:3px
}
@mrkdevelopment
mrkdevelopment / df-breadcrumb-module.css
Created Apr 25, 2017
Divi Framework CSS for the breadcrumb module
View df-breadcrumb-module.css
.breadcrumb_header h1 {
padding:0;
}
.breadcrumb_header .subtitle {
padding-top:15px;
display:block;
}
.breadcrumb_header.all_centered {
@mrkdevelopment
mrkdevelopment / register-custom-faq-view-file.php
Created Apr 26, 2017
Register Custom FAQ view file via a filter
View register-custom-faq-view-file.php
<?php
add_filter('my_custom_faq_view', 'my_custom_faq_view_filter', 10, 1);
function my_custom_faq_view_filter($slugs = array())
{
// set the location of the faq file to a sub directory in the child theme folder.
$slugs['my_custom_faq_slug'] = get_stylesheet_directory() . '/resources/views/my-custom-faq-file.php';
return $slugs;
View sample-faq-view-file.php
<?php
$args = array(
'post_type' => 'faq',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'faq_category',
'field' => 'id',
@mrkdevelopment
mrkdevelopment / link pattern
Created May 4, 2017
Link to product added to cart
View link pattern
@mrkdevelopment
mrkdevelopment / functions.php
Created Jun 18, 2017
Remove Emojis Script from WordPress
View functions.php
/**
* Disable the emoji's
*/
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
@mrkdevelopment
mrkdevelopment / functions.php
Last active Jun 26, 2017
Remove Script Version Numbers in WordPress
View functions.php
// Remove version numbers from resources in WP
function _remove_script_version($src)
{
if (strpos($src, 'googleapis.com')) {
return $src;
}
$parts = explode('?', $src);
return $parts[0];
}
You can’t perform that action at this time.