Skip to content

Instantly share code, notes, and snippets.

View mrkdevelopment's full-sized avatar

Matt Knighton mrkdevelopment

View GitHub Profile
@mrkdevelopment
mrkdevelopment / business-directory-post-type-arg-filter.php
Last active April 9, 2019 04:28
Business Directory Post Type Arg Filter
<?php
// Add this to your child theme's function.php file.
// Make sure you flush the rewrite rules.
// On wp cli you can 'wp rewrite flush'
// Or goto WordPress Admin > Settings > Permalink and save the settings which will flush the rules.
add_filter('business_directory_post_type_args', function($args){
$args['rewrite'] = [
'slug' => '/business-location',
];
return $args;
@mrkdevelopment
mrkdevelopment / functions.php
Created August 26, 2018 09:48
Breadcrumb Update for Yoast Breadcrumbs Path in Custom Post
add_filter( 'wpseo_breadcrumb_links', 'wpse_100012_override_yoast_breadcrumb_trail' );
function wpse_100012_override_yoast_breadcrumb_trail( $links ) {
global $post;
if (is_tax( 'df_product_category' )) {
$breadcrumb[] = array(
'url' => get_post_type_archive_link( 'df_wordpress_product' ),
'text' => 'Products',
@mrkdevelopment
mrkdevelopment / funtions.php
Created August 26, 2018 09:37
Learndash Yoast Breadcrumbs
add_filter( 'wpseo_breadcrumb_links', 'wpse_100012_override_yoast_breadcrumb_trail' );
function wpse_100012_override_yoast_breadcrumb_trail( $links ) {
global $post;
if ( is_singular( 'sfwd-lessons' ) ) {
$course_id = learndash_get_course_id($id);
$course_title = get_the_title($course_id);
@mrkdevelopment
mrkdevelopment / shortcode
Created August 26, 2018 01:44
[\yoast-breadcrumb-df]
[yoast-breadcrumb-df][/yoast-breadcrumb-df]
@mrkdevelopment
mrkdevelopment / functions.php
Created August 6, 2018 22:25
remove divi cpt style action
/**
* Disable new divi crazy crap code for CPT
**/
function disable_cptdivi()
{
remove_action( 'wp_enqueue_scripts', 'et_divi_replace_stylesheet', 99999998 );
}
add_action('init', 'disable_cptdivi');
@mrkdevelopment
mrkdevelopment / divi_open_social_icons_new_tab.js
Created August 3, 2018 08:40
Open existing divi social icons in new tab
jQuery(document).ready(function(){
jQuery('.et-social-icon .icon').each(function(){
jQuery(this).attr('target', '_blank');
});
});
<?php
add_filter( 'df_update_social_icons', function($brands){
$brands['fa-amazon'] = 'Amazon';
return $brands;
});
@mrkdevelopment
mrkdevelopment / conf for prefetch
Created July 10, 2018 06:28
My values for my WP Rocket Prefetch Domains
//fonts.googleapis.com
//fonts.gstatic.com
//www.googletagmanager.com
<div class="df-menu-item ">
<h5>
<span class="menu-title">Garlic King Prawns</span>
</h5>
<div class="right">$ 15.50</div>
<small>Five luscious plump King prawns sautéed in a creamy garlic sauce</small>
</div>
@mrkdevelopment
mrkdevelopment / invalid-restaurant-menu-item.html
Created June 1, 2018 05:55
Semantically invalid restaurant menu item
<div class="df-menu-item ">
<h5>
<div class="left">
<span class="menu-title">Cheese &amp; Sausage Platter</span>
<small>Salami, summer sausage, deli ham rolls, cheddar cheese curds, cubed Parmesan &amp; asiago cheeses, Dusse/dorf mustard, assorted olives &amp; crackers</small>
</div>
<div class="right">$ 10.95</div>
</h5>
</div>