Skip to content

Instantly share code, notes, and snippets.

View kontikidigital's full-sized avatar

Kontiki Digital kontikidigital

View GitHub Profile
@themepaint
themepaint / Register Custom Taxonomy Woocommerce Products
Created April 22, 2016 11:59
Register Custom Taxonomy Woocommerce Products
// Register Custom Taxonomy
function ess_custom_taxonomy_Item() {
$labels = array(
'name' => 'Brands',
'singular_name' => 'Brand',
'menu_name' => 'Brands',
'all_items' => 'All Brands',
'parent_item' => 'Parent Brand',
'parent_item_colon' => 'Parent Brand:',
@themepaint
themepaint / Create Custome Field in Woocommerce Product Page
Created April 18, 2016 09:05
Create Custome Field in Woocommerce Product Page
<?php
// Display Fields
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' );
function woo_add_custom_general_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
@ericakfranz
ericakfranz / soliloquy-slider-image-overlay.css
Created December 7, 2015 18:30
Add an image overlaying a portion of the Soliloquy slider
.soliloquy-container .soliloquy-slider:before {
display: block;
content: '';
width: 50%;
height: 100%;
position: fixed;
right: 0;
z-index: 9;
background: url('http://www.360fashion.net/wp-content/uploads/2013/01/image-placeholder-500x500.jpg');
background-size: contain;
@nickcernis
nickcernis / functions.php
Last active September 6, 2020 06:34
Genesis Simple Share Shortcode
<?php
// Adds a [social-icons] shortcode to output Genesis Simple Share icons in posts
// https://wordpress.org/plugins/genesis-simple-share/
// Add the code below to your active theme's functions.php file,
// or use in a site-specific plugin.
// The shortcode takes no attributes; change your icon settings via Genesis → Simple Share.
add_shortcode( 'social-icons', 'gss_shortcode' );
@freelancedaddytv
freelancedaddytv / functions.php
Created August 9, 2015 15:26
WooCommerce ShortCode Sort by Price
/* Add this to functions.php */
add_filter( 'woocommerce_shortcode_products_query', 'woocommerce_shortcode_products_orderby' );
function woocommerce_shortcode_products_orderby( $args ) {
$standard_array = array('menu_order','title','date','rand','id');
if( isset( $args['orderby'] ) && !in_array( $args['orderby'], $standard_array ) ) {
$args['meta_key'] = '_price';
$args['orderby'] = 'meta_value_num';
add_action( 'wp', 'custom_hidden_comments' );
function custom_hidden_comments() {
$restrictions = wc_memberships()->restrictions;
remove_filter( 'wp', array( $restrictions, 'hide_restricted_content_comments' ) );
}
add_filter( 'wp', 'custom_hide_restricted_content_comments' );
function custom_hide_restricted_content_comments( $content ) {
if ( is_singular() ) {
@mohandere
mohandere / get-isotope-items.php
Last active March 6, 2024 14:20
jQuery isotope plugin for wordpress posts filtering by category with pagination.
<?php
function get_isotope_item( $query_args = array() ){
$defaults = array(
'post_type' => 'post',
'posts_per_page' => -1,
'post_status' => 'publish',
);
@srikat
srikat / functions.php
Created December 5, 2014 11:46
Horizontal Opt-in Form in Genesis using eNews Extended plugin. http://sridharkatakam.com/horizontal-opt-form-genesis-using-enews-extended-plugin/
//* Register Horizontal Opt-In widget area
genesis_register_sidebar(
array(
'id' => 'horizontal-opt-in',
'name' => __( 'Horizontal Opt-In' ),
'description' => __( 'This is the widget area for horizontal opt-in form.' ),
) );
//* Display Horizontal Opt-In below Header
add_action( 'genesis_after_header', 'sk_horizontal_opt_in' );
@daltonrooney
daltonrooney / get_stores_by_location.php
Last active June 29, 2023 14:14
Store locator with Advanced Custom Fields
<?php
function mbn_get_stores_by_location( $zip, $radius ) {
global $wpdb;
$radius = intval( $radius );
// we first need to get the source coordinates
$sql = "SELECT `latitude`, `longitude` FROM `wp_zip_codes` WHERE `zipcode` = '%s'";
$coords = $wpdb->get_row( $wpdb->prepare( $sql, $zip ) );
@barbwiredmedia
barbwiredmedia / functions.php
Created July 15, 2014 20:42
Hide ACF menu item from the admin menu. wordpress functions.php
/**
* Hide ACF menu item from the admin menu
*/
function remove_acf_menu()
{
// provide a list of usernames who can edit custom field definitions here
$admins = array(
'levy-access',