Skip to content

Instantly share code, notes, and snippets.

View landbryo's full-sized avatar
🤠
Always Excitied

Landon Otis landbryo

🤠
Always Excitied
View GitHub Profile
@landbryo
landbryo / enfold_builder_classes.php
Last active May 24, 2018 16:21
Add CSS classes to Enfold Builder
////////////////////////////////
// ADD CSS CLASSES TO BUILDER //
////////////////////////////////
add_theme_support('avia_template_builder_custom_css');
@landbryo
landbryo / blog_list_shortcode.php
Last active May 24, 2018 16:20
Shortcode for displaying a feed of blog posts.
//////////////////////////////
// BLOG LIST FEED SHORTCODE //
//////////////////////////////
add_shortcode( 'bw_blog_list', 'blog_list_shortcode' );
function blog_list_shortcode( $atts ) {
ob_start();
$kblog_args = array(
'post_type' => 'post',
'posts_per_page' => 3,
@landbryo
landbryo / enfold_mobile_logo.php
Last active May 24, 2018 16:20
Adds a mobile logo for Enfold. Logo only displays on mobile devices.
/////////////////
// MOBILE LOGO //
/////////////////
add_filter('avf_logo','av_change_logo');
function av_change_logo($logo) {
if(wp_is_mobile()) {
$logo = get_stylesheet_directory_uri() . '/img/mobile-logo.png';
}
return $logo;
@landbryo
landbryo / add_google_font.php
Last active December 25, 2021 06:41
Adds content font to be used in Enfold options.
////////////////////////////////////
// ADD NEW GOOGLE FONTS TO ENFOLD //
////////////////////////////////////
add_filter( 'avf_google_content_font', 'add_content_font');
function add_content_font($fonts)
{
$fonts['Crimson Text'] = 'Crimson Text:400,400i,700,700i';
return $fonts;
}
@landbryo
landbryo / enqueue_font_awesome.php
Last active May 24, 2018 16:19
Enqueue Font Awesome library via functions.php
//////////////////////////
// ENQUEUE FONT AWESOME //
//////////////////////////
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
}
@landbryo
landbryo / modify_wp_excerpt.php
Last active May 24, 2018 16:18
Modifies WordPress excerpt via functions.php
////////////////////
// CUSTOM EXCERPT //
////////////////////
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function custom_excerpt_more( $more ) {
@landbryo
landbryo / enqueue_google_font_1.php
Last active May 24, 2018 16:18
Enqueue Google Font via functions.php
/////////////////////////
// ENQUEUE GOOGLE FONT //
/////////////////////////
add_action('wp_enqueue_scripts', 'custom_google_fonts');
function keokee_google_fonts() {
wp_enqueue_style( 'keokee_google_fonts', '//fonts.googleapis.com/css?family=Montserrat:400,700' );
}
@landbryo
landbryo / yoast_to_bottom.php
Last active May 24, 2018 16:17
Moves Yoast SEO box to below all other content fields in WordPress dashboard.
/////////////////////
// YOAST TO BOTTOM //
/////////////////////
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@landbryo
landbryo / custom_excerpt_length.php
Last active May 24, 2018 16:17
Custom WordPress excerpt length via functions.php
///////////////////////////
// CUSTOM EXCERPT LENGTH //
///////////////////////////
function custom_excerpt_length($length) {
return 40;
}
add_filter('excerpt_length', 'custom_excerpt_length');
@landbryo
landbryo / dashboard_css.php
Last active May 24, 2018 16:17
Add custom css to dashboard via functions.php
//////////////////////
// DASHBOARD STYLES //
//////////////////////
function dashboard_custom_css() {
wp_enqueue_style('dashboard-style', get_stylesheet_directory_uri() . '/css/dashboard.css');
}
add_action('admin_head', 'dashboard_custom_css');