Skip to content

Instantly share code, notes, and snippets.

View bhwebworks's full-sized avatar

John Sundberg bhwebworks

View GitHub Profile
@workeffortwaste
workeffortwaste / woocommerce-to-css-grid.css
Last active January 22, 2024 15:52
woocommerce-to-css-grid
/* Convert the standard WooCommerce products list into a modern responsive grid. */
ul.products {
--grid-gap: 32px;
--auto-grid-min-size: 200px;
grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
grid-gap: var(--grid-gap);
display: grid;
}
ul.products:before{
content:unset!important;
@spivurno
spivurno / gw-gravity-forms-user-registration-skip-registration-for-existing-email.php
Last active September 14, 2021 13:01
Gravity Wiz // Gravity Forms // User Registration // Skip Registration if Email Exists
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-user-registration-skip-registration-for-existing-email.php
*/
/**
* Gravity Wiz // Gravity Forms // User Registration // Skip Registration if Email Exists
*
* If submitted email is already registered, skip registration.
<?php
/**
* Blog Intro
*
*/
function be_blog_intro() {
$content = get_post( get_option( 'page_for_posts' ) )->post_content;
if( $content )
echo '<div class="blog-intro">' . wpautop( $content ) . '</div>';
@jchristopher
jchristopher / gist:7312074
Last active August 12, 2020 02:43
Supplemental SearchWP search engine integration with Genesis, supports pagination
<?php
/* Template Name: Genesis and SearchWP integration with pagination */
function prefix_searchwp_form( $query ) {
echo '<form class="searchwp-form" action="" method="get">';
echo '<input type="text" id="searchwpquery" name="searchwpquery" value="' . esc_attr( $query ) . '" />';
echo '<button type="submit">' . __( 'Search', 'text-domain' ) . '</button>';
echo '</form>';
}
@thomasgriffin
thomasgriffin / gist:7308584
Created November 4, 2013 20:17
Blank canvas for styling a Soliloquy slider.
<?php
add_action( 'tgmsp_before_slider_output', 'tgm_custom_slider_theme' );
function tgm_custom_slider_of_madness( $id ) {
// If not the proper slider ID, do nothing. Change to match your slider ID.
if ( '324' !== $id ) return;
// Dequeue the default styles.
wp_dequeue_style( 'soliloquy-style' );
@ChrisCree
ChrisCree / functions.php
Last active April 18, 2020 20:51
Adding a custom.css stylesheet to your Genesis child theme (will work for non Genesis themes as well). First create a custom.css file with your custom styles and FTP it up to your child theme directory. Then add the below code to your child theme's functions.php file.
<?php
// Do not copy opening php tag above
add_action( 'wp_enqueue_scripts', 'wsm_custom_stylesheet', 20 );
function wsm_custom_stylesheet() {
wp_enqueue_style( 'custom-style', get_stylesheet_directory_uri() . '/custom.css' );
}
@stephenharris
stephenharris / who-killed-wordpress.php
Created April 3, 2013 18:01
Who killed WordPress? Useful for when you're get rogue 'Are you sure messages?' Not for production folks...
<?php
function who_killed_me( $handler ){
print_r( wp_debug_backtrace_summary() );
return $handler;
}
add_filter( 'wp_die_handler', 'who_killed_me' );
?>
@ninnypants
ninnypants / change-featured-img-text.php
Created March 2, 2012 07:19
Change featured image text
@chrisguitarguy
chrisguitarguy / email-reminder.php
Created September 28, 2011 02:08
Sends an email reminder if you haven't posted on your WordPress blog in a week
<?php
/*
Plugin Name: Reminder Emails
Plugin URI: http://www.christopherguitar.net/
Description: Sends a reminder email if you haven't posted in seven days.
Version: n/a
Author: Christopher Davis
Author URI: http://www.christopherguitar.net
License: GPL2, Creative Commons
*/
@chuckreynolds
chuckreynolds / Wordpress .HTACCESS file
Created June 25, 2009 06:39
Hardened .htaccess file for WP installs
# canonical redirect to no www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# protect wp-config at all cost
<files wp-config.php>
Order deny,allow
deny from all
</files>