Skip to content

Instantly share code, notes, and snippets.

View marisqaporter's full-sized avatar

marisqaporter

View GitHub Profile
@marisqaporter
marisqaporter / page-tpl.php
Last active April 2, 2018 22:26
to add full width hero images to drupal theme omega 3
<!--marisa custom sub hero if statements
place in between slideshow and panel_fullwidth
-->
<?php /* Custom Work: Sub Page Hero */
if(isset($node->type) && $node->type == 'page'){
$field_basic_hero_image = field_get_items('node', $node, 'field_basic_hero_image');
$hero_url = file_create_url($field_basic_hero_image[0]['uri']);
}?>
@marisqaporter
marisqaporter / 218.css
Last active November 1, 2016 22:33
code-fix
.easy-breadcrumb a {
margin-left: -34px;
/* background-image: url(/sites/default/files/navigation-tab-bg.png); */
padding: 12px 50px 14px;
color: #666;
background-position: top right;
background-repeat: no-repeat;
font-weight: normal;
}
/**
*
* @author Calvin Makes
* @link http://www.calvinmakes.com/
* @version 1.0
*
* Add previous and next buttons to custom post types.
*/
function cm_custom_navigation_links() {
@ericakfranz
ericakfranz / functions.php
Created April 10, 2015 18:36
Automatically wrap each Soliloquy caption text line in a paragraph tag.
add_filter( 'soliloquy_output_item_data', 'ekf_filter_caption_paragraph_tags', 10, 3 );
function ekf_filter_caption_paragraph_tags( $image, $id, $data) {
// Wrap the image caption text in paragraph tags
$image['caption'] = wpautop( $image['caption'] );
// Return the modified data.
return $image;
}
@n7studios
n7studios / soliloquy-link-captions.php
Last active May 19, 2017 04:12
Soliloquy - Link Captions
@srikat
srikat / functions.php
Last active April 29, 2021 22:22
CSS for Multi-Column Footer Widgets in Genesis. http://sridharkatakam.com/css-multi-column-footer-widgets-genesis/
//* Add support for 3-column footer widgets
add_theme_support( 'genesis-footer-widgets', 3 );
@scottmcdaniel
scottmcdaniel / Styling Gravity Forms Error Messages
Created February 5, 2014 20:42
Styling Gravity Forms Error Messages
/* Gravity forms error handling - February 5, 2014 */
/* ############################################### */
/* Make the error stand out */
.gfield_error{
background-color: white;
color:#b94a48;
}
/* Prepend the error message to the missing but required field */
.gfield_error:before {
@eugenoprea
eugenoprea / functions.php
Last active December 12, 2015 02:38
Genesis - Custom Post Class
// Add custom post class to posts in the "Featured" category
add_filter('post_class', 'eo_custom_post_class');
function eo_custom_post_class($classes)
{
$new_class = 'featured-post';
if (in_category('Featured'))
$classes[] = esc_attr(sanitize_html_class($new_class));
return $classes;
}
<?php
/**
* Fix Gravity Form Tabindex Conflicts
* http://gravitywiz.com/fix-gravity-form-tabindex-conflicts/
*/
add_filter( 'gform_tabindex', 'gform_tabindexer', 10, 2 );
function gform_tabindexer( $tab_index, $form = false ) {
$starting_index = 1000; // if you need a higher tabindex, update this number
if( $form )
add_filter( 'gform_tabindex_' . $form['id'], 'gform_tabindexer' );
@BronsonQuick
BronsonQuick / gravity_forms_validation.php
Created April 12, 2012 09:51
Change the default validation message and add validation on default values in Gravity Forms
<?php
//This is a filter to change the default validation message that Gravity Forms generates
add_filter('gform_validation_message', 'change_validation_message', 10, 2);
function change_validation_message($message, $form)
{
return "<div class='validation_error'><strong>Oops!</strong> Looks like there’s something wrong. Please review the form above.</div>";
}
// Often forms in Gravity Forms to need to start with default values and we need to check the form in case the user hasn't entered new data and give them a validation message back