Skip to content

Instantly share code, notes, and snippets.

View tlctara's full-sized avatar

Tara Claeys tlctara

View GitHub Profile
@tlctara
tlctara / Beaver Builder Mega Menu Integration CSS Example
Last active May 8, 2020 15:43
CSS to customize Beaver Builder Mega Menu with columns as sub pages, images and intro text
/* This code hides the column headers when they are a sub-menu item */
.fl-menu .sub-menu .fl-has-submenu-container {
display:none;
}
/* This code styles the images and intro text in the mega menu */
.menu-image a {
visibility: hidden;
margin-top: -20px!important;
}
// Adds descriptions to menus
function prefix_nav_description( $item_output, $item, $depth, $args ) {
if ( !empty( $item->description ) ) {
$item_output = str_replace( $args->link_after . '</a>', '<p class="menu-item-description">' . $item->description . '</p>' . $args->link_after . '</a>', $item_output );
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'prefix_nav_description', 10, 4 );
@tlctara
tlctara / imagesize.php
Created July 21, 2016 20:44
Register Image Sizes
//* Register custom image sizes
add_image_size( 'welcome', 500, 300, true );
add_image_size( 'home-featured', 300, 150, true );
//* Add support for custom header
add_theme_support( ‘custom-header’, array(
‘width’ => 400,/*Set this to whatever your theme calls for*/
‘height’ => 120,/*Set this to whatever your theme calls for*/
‘header-selector’ => ‘.site-title a’,
‘header-text’ => false,
) );
.header-image .site-title > a {
background: url(assets/images/logo.png) no-repeat left;
float: left;
min-height: 125px;
max-width: 415px;
width: 100%;
-webkit-transition: all 200ms ease;
transition: all 200ms ease;
}
.new-special {
width: 100%;
float: left;
background-color: #e5e5e5;
margin: 0 auto;
}
.new-special .widget {
width: 45%;
float: left;
<?php
/**
* This file adds a Home Page Template to the theme.
*
function tlc_new_special() {
genesis_widget_area( 'new-special', array(
'before' => '<div class="new-special widget-area">',
'after' => '</div>',
) );
//* Add the home widgets in place
function tlc_home_page_widgets() {
if ( is_front_page('') )
genesis_widget_area ('new-special', array(
'before' => '<div class="new-special widget-area">',
'after' => '</div></div>',));
}
add_action( 'genesis_before_content', 'tlc_home_page_widgets' );
//* Hook new special widget area after header (or wherever you want - use Genesis Hook Guide to change 'genesis_after_header' to whatever applies)
add_action( 'genesis_after_header', 'tlc_new_special_widget' );
function tlc_new_special_widget() {
genesis_widget_area( 'new-special', array(
'before' => '<div class="new-special widget-area"><div class="wrap">',
'after' => '</div></div>',
) );
}
@tlctara
tlctara / gravity-forms-big-button
Created March 9, 2016 03:06
Gravity Forms Big Button
.ginput_price {
display: none;
}
.gfp_big_button .gfield_radio li input[type=radio] {
display:none;
}
.gfp_big_button .gfield_radio label {
max-width: 300px;
width: 100%;