Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
jamiemitchell / functions.php
Created December 28, 2017 22:08 — forked from jameskoster/functions.php
WooCommerce - Remove product data tabs
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
@jamiemitchell
jamiemitchell / add-to-woocommerce-additional-info-tab-single-product.php
Created December 28, 2017 09:45 — forked from ben-heath/add-to-woocommerce-additional-info-tab-single-product.php
Add content to WooCommerce Additional Information Tab on Single Products
<?php
// This code should be added to the functions.php file of the child theme
// Add custom info to Additional Information product tab
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
global $product;
$tabs['additional_information']['callback'] = 'custom_function_name'; // this is the function name which is included below
return $tabs;
}
@jamiemitchell
jamiemitchell / woo-prod-description.php
Created December 28, 2017 09:05 — forked from neilgee/woo-prod-description.php
WooCommerce Move Product Description Above Product
<?php //<~ don't add me in
add_action( 'woocommerce_before_single_product', 'themeprefix_woocommerce_template_product_description', 20 );
/**
* Add product description above product
* Output description tab template using 'woocommerce_before_single_product' hook
*/
function themeprefix_woocommerce_template_product_description() {
wc_get_template( 'single-product/tabs/description.php' );
@jamiemitchell
jamiemitchell / grvity-forms-css-reset
Created December 15, 2017 20:01 — forked from royhoshen/grvity-forms-css-reset
Reset Gravity forms error fields css
.gform_wrapper div.validation_error {
display: none;
}
.gform_wrapper form li.gfield.gfield_error {
margin-top: 0;
margin-bottom: 0 !important;
background-color: transparent;
@jamiemitchell
jamiemitchell / Gravity Forms CSS only Reset Styles
Created December 15, 2017 19:58 — forked from forgeandsmith/Gravity Forms CSS only Reset Styles
Gravity Forms CSS only reset styles for easy style editing and management
.gform_heading,
.gform_body,
.gform_footer {
clear: both;
padding-bottom: 20px;
}
ul.gform_fields {
list-style: none;
margin: 0 -15px;
@jamiemitchell
jamiemitchell / backstretch-init.js
Created December 15, 2017 03:43 — forked from neilgee/backstretch-init.js
Using Multiple Images in Backstretch - ACF
jQuery(document).ready(function($) {
$(".header").backstretch([ // Target your HTML element
'/wp-content/uploads/2016/09/image-1.jpg', // Add in your images
'/wp-content/uploads/2016/09/image-2.jpg',
],{
duration:3000, // Time between transitions
fade:750, // Transition effect
});
@jamiemitchell
jamiemitchell / comment-form.php
Created December 7, 2017 21:44 — forked from ChrisCree/comment-form.php
Remove comments from specific category posts in the Genesis theme framework.
<?php
// Do not copy opening PHP tag above
// Remove comments from specific categories. Change out categories in array as needed.
add_action( 'wp_enqueue_scripts', 'wsm_remove_comments_in_category' );
function wsm_remove_comments_in_category() {
if ( in_category( array( 'No Comments', 'Uncategorized', ) ) ) {
remove_action( 'genesis_after_post', 'genesis_get_comments_template' );
remove_action( 'genesis_after_entry', 'genesis_get_comments_template' );
remove_action( 'genesis_comment_form', 'genesis_do_comment_form' );
<?php
/**
* @author Brad Dalton
* @link https://wpsites.net/web-design/add-custom-field-to-genesis-loop/
*/
add_action( 'genesis_entry_content', 'function_name', 12 );
function function_name() {
$value = get_post_meta( get_the_ID(), 'key', true );
@jamiemitchell
jamiemitchell / archive-corso.php
Created December 7, 2017 06:45 — forked from simocsdk/archive-corso.php
multiple_loop filterable portfolio taxonomy genesis
function filterable_portfolio_do_loop() {
$args = array(
'public' => true,
);
$customPostTaxonomies = get_object_taxonomies('corso');
if ( $customPostTaxonomies ) {
foreach($customPostTaxonomies as $tax) {
<?php
/**
* Have WordPress match postname to any of our public post types (post, page, race).
* All of our public post types can have /post-name/ as the slug, so they need to be unique across all posts.
* By default, WordPress only accounts for posts and pages where the slug is /post-name/.
*
* @param $query The current query.
*/
function gp_add_cpt_post_names_to_main_query( $query ) {