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 | |
/** | |
* Recursive argument parsing | |
* | |
* This acts like a multi-dimensional version of wp_parse_args() (minus | |
* the querystring parsing - you must pass arrays). | |
* | |
* Values from $a override those from $b; keys in $b that don't exist | |
* in $a are passed through. |
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: WooCommerce Plugin Templates | |
* Plugin URI: http://jeroensormani.com | |
* Description: A simple demo plugin on how to use template files within your plugin. | |
*/ | |
/** | |
* Locate template. |
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
/* | |
From http://jakeparis.com/2015/05/debugging-wordpress-rewrite-rules/ | |
*/ | |
function jp_debug_rewrite_rules($where = 'head') { | |
// only do this on public side | |
if( is_admin() ) return false; | |
switch($where) { | |
case 'foot' : |
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 | |
// Edition 1 | |
$taxonomy_name = 'sample-cpt-category'; | |
if ( is_tax( $taxonomy_name ) ) { | |
$current_taxonomy_term = get_queried_object_id(); | |
$args = array( |
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
.element { | |
text-indent: -9999px; | |
line-height: 0; /* Collapse the original line */ | |
} | |
.element::after { | |
content: "New text"; | |
text-indent: 0; | |
display: block; | |
line-height: initial; /* New content takes up original line height */ |
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
add_filter('post_thumbnail_html', 'slug_responsive_img', 5, 5); | |
//Image sizes for Interchange | |
add_image_size( 'fd-lrg', 1024, 99999); | |
add_image_size( 'fd-med', 768, 99999); | |
add_image_size( 'fd-sm', 320, 9999); | |
function slug_responsive_img($html, $post_id, $post_thumbnail_id, $size, $attr) { | |
//make image links | |
$attachment_id = $post_thumbnail_id; | |
$default = wp_get_attachment_image_src($attachment_id); |
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 | |
function mxd_columns($columns) { | |
$columns['template'] = 'Template'; | |
return $columns; | |
} | |
function mxd_show_template_columns($name, $post_id) { | |
$template = get_post_meta($post_id, '_wp_page_template', true); | |
echo $template; | |
} |
OlderNewer