Skip to content

Instantly share code, notes, and snippets.

View kontikidigital's full-sized avatar

Kontiki Digital kontikidigital

View GitHub Profile
@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' );
@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',
);
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() ) {
@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';
@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' );
@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;
@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">';
@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:',
@Komock
Komock / function.php
Created April 23, 2016 21:30
Genesis remove .site-inner markup
<?php
//* Remove .site-inner
add_filter( 'genesis_markup_site-inner', '__return_null' );
add_filter( 'genesis_markup_content-sidebar-wrap_output', '__return_false' );
add_filter( 'genesis_markup_content', '__return_null' );
?>
@Niloys7
Niloys7 / gist:17b88d36c1c38844a6cf2127c15dee63
Created February 24, 2017 01:17
Get Product Gallery Images - WooCommerce
<?php
global $product;
$attachment_ids = $product->get_gallery_attachment_ids();
foreach( $attachment_ids as $attachment_id )
{
//Get URL of Gallery Images - default wordpress image sizes
echo $Original_image_url = wp_get_attachment_url( $attachment_id );
echo $full_url = wp_get_attachment_image_src( $attachment_id, 'full' )[0];
echo $medium_url = wp_get_attachment_image_src( $attachment_id, 'medium' )[0];