Skip to content

Instantly share code, notes, and snippets.

View jasonbraun's full-sized avatar
:octocat:
GitHub-ing

Jason Braun jasonbraun

:octocat:
GitHub-ing
View GitHub Profile
@jasonbraun
jasonbraun / functions.php
Last active April 11, 2017 19:31
Add the ability to use shortcodes in widgets
<?php
//* Add the ability to use shortcodes in widgets
add_filter( 'widget_text', 'do_shortcode' );
@jasonbraun
jasonbraun / functions.php
Last active April 11, 2017 19:31
Prevent WordPress from compressing images
<?php
//* Prevent WordPress from compressing images
add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );
@jasonbraun
jasonbraun / functions.php
Last active April 11, 2017 19:30
Remove 'Editor' from 'Appearance' Menu in WordPress
<?php
//* Remove 'Editor' from 'Appearance' Menu.
//* This stops users and hackers from being able to edit files from within WordPress.
define( 'DISALLOW_FILE_EDIT', true );
@jasonbraun
jasonbraun / functions.php
Last active December 19, 2020 15:17
Add theme info box into WordPress Dashboard
<?php
//* Add theme info box into WordPress Dashboard
add_action('wp_dashboard_setup', 'website_name_add_dashboard_widgets' );
function website_name_add_dashboard_widgets() {
wp_add_dashboard_widget('wp_dashboard_widget', 'Theme Details', 'website_name_theme_info');
}
@jasonbraun
jasonbraun / functions.php
Last active April 11, 2017 19:35
Custom Footer Text in Admin Panel
<?php
//* Modify the admin footer text
add_filter( 'admin_footer_text', 'website_name_modify_footer_admin' );
function website_name_modify_footer_admin () {
echo '<span id="footer-thankyou">Theme Development by <a href="http://braundesign.co" target="_blank">Braun Design Co</a></span>';
}
@jasonbraun
jasonbraun / functions.php
Last active April 11, 2017 19:34
Custom Login Logo for WordPress
<?php
//* Login Screen: Change login logo
add_action( 'login_head', 'website-name_custom_login_logo' );
function website-name_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_stylesheet_directory_uri().'/images/login.png) !important; background-size: 150px 137px !important; height: 137px !important; width: 150px !important; margin-bottom: 30px !important; padding-bottom: 0 !important; }
.login form { margin-top: 10px !important; }
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
@jasonbraun
jasonbraun / functions.php
Last active April 11, 2017 19:33
Remove items from The WP Head section
<?php
//* Remove items from the <head> section
remove_action( 'wp_head', 'wp_generator' ); //* Remove WP Version number
remove_action( 'wp_head', 'wlwmanifest_link' ); //* Remove wlwmanifest_link
remove_action( 'wp_head', 'rsd_link' ); //* Remove rsd_link
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); //* Remove shortlink
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); //* Remove previous/next post links
@jasonbraun
jasonbraun / settings.json
Last active April 11, 2017 19:33
My Sublime User Settings
{
"color_scheme": "Packages/Theme - Cobalt2/cobalt2.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "Source Code Pro for Powerline",
"font_size": 13,
"ignored_packages":
[
"Vintage"
],