Skip to content

Instantly share code, notes, and snippets.

@tiborp
tiborp / gist:4705486
Last active December 12, 2015 03:18
Always show Kitchen Sink in WordPress WYSIWYG Editor (so you don't have to explain this to clients every time ;-))
<?php
// Always show Kitchen Sink in WYSIWYG Editor
add_filter( 'tiny_mce_before_init', 'yourprefix_unhide_kitchensink' );
function yourprefix_unhide_kitchensink($args) {
$args['wordpress_adv_hidden'] = false;
return $args;
}
@tiborp
tiborp / Genesis Custom Favicon
Last active December 14, 2015 08:08
functions.php
<?php
// Load custom favicon
add_filter( 'genesis_pre_load_favicon', 'custom_favicon_filter' );
function custom_favicon_filter( $favicon_url ) {
return CHILD_URL .'/images/favicon.ico';
}
@tiborp
tiborp / conditional-gf-notifications.php
Created March 12, 2013 11:43
Condtional auto-reply message for GravityForms
<?php
// http://www.gravityhelp.com/forums/topic/conditional-logic-for-user-notifications
// update the "2" to the ID of your form
add_filter('gform_pre_submission_filter_2', 'your_prefix_conditional_message');
function your_prefix_conditional_message($form){
// update the "7_1" following "input_" to the IDs of your fields
$choice1 = RGForms::post('input_7_1');
$choice2 = RGForms::post('input_7_2');
$choice3 = RGForms::post('input_7_3');
@tiborp
tiborp / functions.php
Last active December 17, 2015 03:58
Add custom image sizes to WordPress Media Uploader choices
<?php
/** Add Custom images sizes to Media Uploader */
add_filter( 'image_size_names_choose', 'your_image_size_names_choose' );
function your_image_size_names_choose( $sizes ) {
$sizes = get_intermediate_image_sizes();
$add_sizes = array();
<?php
add_filter( 'genesis_attr_content', 'yoast_schema_empty', 20 );
add_filter( 'genesis_attr_entry', 'yoast_schema_event', 20 );
add_filter( 'genesis_attr_entry-title', 'yoast_itemprop_name', 20 );
add_filter( 'genesis_attr_entry-content', 'yoast_itemprop_description', 20 );
add_filter( 'genesis_post_title_output', 'yoast_title_link_schema', 20 );
/**
* We'll use the post info output to add more meta data about the event.
@tiborp
tiborp / gist:7410531
Last active December 27, 2015 23:59
Dropdown with GravityForms
<?php
$select = '<select>';
$forms = RGFormsModel::get_forms( null, 'title' );
foreach( $forms as $form ):
$select .= '<option id="' . $form->id . '">' . $form->title . '</option>';
endforeach;
$select .= '</select>';
echo "GF dropdown: $select";
@tiborp
tiborp / style.css
Created November 12, 2013 13:59 — forked from WebEndevSnippets/style.css
4 column GravityForms CSS ready class
/* 4 column Gravity Forms custom ready class ------------------------------------------------------*/
.gform_wrapper .top_label li.gfield.gf_first_quarter,
.gform_wrapper .top_label li.gfield.gf_second_quarter,
.gform_wrapper .top_label li.gfield.gf_third_quarter,
.gform_wrapper .top_label li.gfield.gf_fourth_quarter {
margin:0 0 8px 0;
width:24%;
}
@tiborp
tiborp / functions.php
Last active February 3, 2022 09:53
Add span tag around WordPress menu item
<?php
/**
* Add span to menu items with icon class so we can hide the text and show icons instead
*
* @link http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items
*/
add_filter( 'walker_nav_menu_start_el', 'hrt_span_to_nav_menu', 10, 4 );
function hrt_span_to_nav_menu( $item_output, $item, $depth, $args ) {
if ( isset( $item->classes ) && !empty( $item->classes ) ) {
@tiborp
tiborp / bootstrap-wide.css
Created April 25, 2014 19:47
Extra media queries for BIG screens
// Extra big for Twitter Bootstrap
@media screen and (min-width: 1400px) {
.container {
width: 1370px;
}
}
@media screen and (min-width: 1600px) {
.container {
width: 1570px;
@tiborp
tiborp / functions.php
Last active October 4, 2017 14:37
Conditional to check whether Gravity Forms shortcode is on a page
<?php
// conditional to check whether Gravity Forms shortcode is on a page
function lwd_has_gform() {
global $post;
$all_content = get_the_content();
if (strpos($all_content,'[gravityform') !== false) {
return true;
} else {
return false;
}