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
/* | |
Theme Name: twentysixteen Child Theme | |
Theme URI: https://rm314.com | |
Description: A bare-bones child theme for use with twentysixteen Theme. | |
Author: Jimmy Knoll | |
Author URI: http://jimmyknoll.com/ | |
Template: twentysixteen | |
Version: 1.0.0 | |
*/ | |
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_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' ); | |
function enqueue_parent_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); | |
} |
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
// exclude pages from search | |
function SearchFilter($query) { | |
if ($query->is_search) { | |
$query->set('post_type', 'post'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','SearchFilter'); |
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
// shortcode to show related posts by tags | |
function related_posts_shortcode( $atts ) { | |
extract(shortcode_atts(array( | |
'limit' => '5', | |
), $atts)); | |
global $wpdb, $post, $table_prefix; |
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
// enable shortcodes in widgets | |
add_filter('widget_text', 'do_shortcode'); |
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
// create column shortcodes | |
function rm314_one_third( $atts, $content = null ) { | |
return '<div class="one_third">' . do_shortcode($content) . '</div>'; | |
} | |
add_shortcode('one_third', 'rm314_one_third'); | |
function rm314_one_third_last( $atts, $content = null ) { | |
return '<div class="one_third last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; | |
} | |
add_shortcode('one_third_last', 'rm314_one_third_last'); |
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
//disabling WordPress’s auto-formating filters ( get rid of p tags, br tags, etc.. ) | |
function rm314_formatter($content) { | |
$new_content = ''; | |
/* Matches the contents and the open and closing tags */ | |
$pattern_full = '{(\[raw\].*?\[/raw\])}is'; | |
/* Matches just the contents */ | |
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is'; | |
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
//Long posts should require a higher limit, see http://core.trac.wordpress.org/ticket/8553 | |
@ini_set('pcre.backtrack_limit', 500000); |
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
/*styles responsive column shortcodes*/ | |
.one_half { | |
width: 48%; | |
border: solid 1px #eee | |
} | |
.one_third { | |
width: 30.66%; | |
border: solid 1px #eee | |
} | |
.two_third { |
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
function rm314_column_stylesheet() { | |
$my_style_url = WP_PLUGIN_URL . '/rm314_column_shortcodes/styles.css'; | |
$my_style_file = WP_PLUGIN_DIR . '/rm314_column_shortcodes/styles.css'; | |
if ( file_exists($my_style_file) ) { | |
wp_register_style('column-styles', $my_style_url); | |
wp_enqueue_style('column-styles'); | |
} | |
} | |
add_action('wp_print_styles', 'rm314_column_stylesheet'); |
OlderNewer