Skip to content

Instantly share code, notes, and snippets.

View rwdevpixelparlor's full-sized avatar

Rob Williams rwdevpixelparlor

View GitHub Profile
@rwdevpixelparlor
rwdevpixelparlor / functions.php
Created March 5, 2018 16:12
WP Enqueue New Styles
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'divi', get_template_directory_uri() . '/style.css' );
//wp_enqueue_script( 'divi', plugin_dir_url( __FILE__ ) . 'js/scripts.js', array( 'jquery', 'divi-custom-script' ), '0.1.2', true );
wp_enqueue_script( 'app', get_bloginfo( 'stylesheet_directory' ) . '/js/scripts.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_style( 'normalize', get_bloginfo( 'stylesheet_directory' ) . '/css/normalize.css');
wp_enqueue_style( 'font', get_bloginfo( 'stylesheet_directory' ) . '/css/typography.css');
}
// For Divi Child Theme (Can be used with other themes)
@rwdevpixelparlor
rwdevpixelparlor / first_child_after_targeting.css
Last active February 2, 2018 15:38
Target After the First child CSS
ul#top-menu li:nth-child(1) a:after {
font-family: FontAwesome;
font-weight: normal;
font-style: normal;
display: inline-block !important;
text-decoration: inherit !important;
content: '\f095';
color: #F4F41F !important;
padding-right: 5px;
}
@rwdevpixelparlor
rwdevpixelparlor / wp_auto_link_featured_image_to_posts.php
Created January 25, 2018 19:33
Automatically Link Featured Images to Posts
<?php
add_filter('xmlrpc_enabled', '__return_false');
?>
@rwdevpixelparlor
rwdevpixelparlor / style.css
Last active January 25, 2018 19:31
wp_add_author_info_box
.author_bio_section{
background: none repeat scroll 0 0 #F5F5F5;
padding: 15px;
border: 1px solid #ccc;
}
.author_name{
font-size:16px;
font-weight: bold;
}
<?php
function my_myme_types($mime_types){
$mime_types['svg'] = 'image/svg+xml'; //Adding svg extension
$mime_types['psd'] = 'image/vnd.adobe.photoshop'; //Adding photoshop files
return $mime_types;
}
add_filter('upload_mimes', 'my_myme_types', 1, 1);
?>
.even {
background:#f0f8ff;
}
.odd {
background:#f4f4fb;
}
<?php
// Enable shortcodes in text widgets
add_filter('widget_text','do_shortcode');
?>
<?php
function exclude_category($query) {
if ( $query->is_feed ) {
$query->set('cat', '-5, -2, -3');
}
return $query;
}
add_filter('pre_get_posts', 'exclude_category');