Skip to content

Instantly share code, notes, and snippets.

View ellenbo's full-sized avatar

Ellen Boeke ellenbo

  • Avietech
  • Fort Collins, CO
View GitHub Profile
$('p').each(function(){
var string = $(this).html();
string = string.replace(/ ([^ ]*)$/,' $1');
$(this).html(string);
});
// In Genesis, add this to the Header Scripts:
<script>
// Hide Gravity Form field labels when using placeholders
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );
@ellenbo
ellenbo / style.css
Last active November 14, 2017 21:27
Space two items in a flexbox with the left and right edges aligned with the outer container.
.flex-container {
padding: 0;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
@ellenbo
ellenbo / parallax.js
Last active November 11, 2017 00:09 — forked from srikat/parallax.js
Applying Parallax effect from Parallax Pro in any Genesis theme. http://sridharkatakam.com/apply-parallax-effect-parallax-pro-genesis-theme/
// Add widget areas
add_action( 'genesis_entry_content', 'function_name' );
function function_name() {
echo '<div class="CLASS_NAME parallax-section"></div>';
}
@ellenbo
ellenbo / functions.php
Last active February 26, 2018 21:07
Add Toolset View to template file
// Field
types_render_field( "field-slug", array( ) )
// View
$view_variable_name = array( 'title' => 'View Name' );
echo render_view( $view_variable_name );
// Content Template
echo render_view_template( ID-OF-CONTENT-TEMPLATE );
@ellenbo
ellenbo / Set tag cloud font size in WP
Last active October 12, 2017 17:48
Set tag cloud font size in WP
/* Set tag cloud font size
----------------------------------------------------------------*/
add_filter('widget_tag_cloud_args','set_tag_cloud_sizes');
function set_tag_cloud_sizes($args) {
$args['smallest'] = SMALLEST FONT SIZE;
$args['largest'] = LARGEST FONT SIZE;
return $args;
}
@ellenbo
ellenbo / Change Gravity Forms input button
Created July 16, 2015 15:27
Change Gravity Forms input button
<?php
//put this in functions.php (do not copy the opening and closing php tags)
// filter the Gravity Forms button type
add_filter( 'gform_submit_button', 'form_submit_button', 10, 2 );
function form_submit_button( $button, $form ) {
return "<button class='button' id='gform_submit_button_{$form['id']}'><span>Submit</span></button>";
}
@ellenbo
ellenbo / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ellenbo
ellenbo / Add user to DB using SQL query
Last active November 2, 2017 19:07
Add user to DB using SQL query
INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'demo', MD5('demo'), 'Your Name', 'test@yourdomain.com', 'http://www.test.com/', '2011-06-07 00:00:00', '', '0', 'Your Name');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');
source: http://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-to-the-wordpress-database-via-mysql/
@ellenbo
ellenbo / Set Number of Posts per Page
Created February 13, 2015 23:07
Set Number of Posts per Page
<?php
function five_posts_on_homepage( $query ) {
$query->set( 'posts_per_page', 5 );
}
add_action( 'pre_get_posts', 'five_posts_on_homepage' );
?>