No longer kept up to date.
Please see Sridhar's fork.
| add_filter( 'projects_loop_columns', 'jk_projects_columns', 99 ); | |
| function jk_projects_columns( $cols ) { | |
| $cols = 3; | |
| return $cols; | |
| } |
| <?php function sz_get_testimonials( $page_id ){ | |
| $testimonials = get_post_meta( $page_id, 'testimonial', false ); | |
| if ( $testimonials ) { | |
| $testimonial_list = "\n<ul>\n"; | |
| foreach ( $testimonials as $testimonial ) { | |
| $testimonial_image = false; | |
| $testimonial_content = false; | |
| $testimonial_list .= "\t<li class='row'>"; | |
| if ( $testimonial['testimonial-image'] ) { | |
| $testimonial_image = wp_get_attachment_image( $testimonial['testimonial-image'], 'full', '', array( 'class' => 'columns small-3' ) ); |
| // Usage: | |
| // get_id_by_slug('any-page-slug'); | |
| function get_id_by_slug($page_slug) { | |
| $page = get_page_by_path($page_slug); | |
| if ($page) { | |
| return $page->ID; | |
| } else { | |
| return null; | |
| } |
| @media only screen and (min-width: 768px) { | |
| /* Desktop styles go below this line */ | |
| #secondary-menu-container{ | |
| display: block !important; | |
| } | |
| #secondary-menu-container-mobile{ | |
| display: none !important; | |
| } | |
| } |
| add_action( 'woo_nav_inside', 'woo_custom_add_secondary_menu_to_mobile_nav', 10 ); | |
| function woo_custom_add_secondary_menu_to_mobile_nav () { | |
| $menu_location = 'secondary-menu'; // Change this to be whichever menu location you want to add. | |
| if ( has_nav_menu( $menu_location ) ) { | |
| echo '<div id="' . $menu_location . '-container-mobile" class="col-full custom-menu-location">' . " "; | |
| echo '<h3 class="secondary-menu">Secondary Menu</h3>'; |
No longer kept up to date.
Please see Sridhar's fork.
| <?php | |
| /** | |
| Plugin Name: Gravity Forms Cookies | |
| Plugin URI: http://ounceoftalent.com/ | |
| Description: Saves the query string parameters from a users visit to a cookie and allows these values to be populated via Gravity Forms' Dynamic Population feature. | |
| Version: 1.5 | |
| Author: David Smith | |
| Author URI: http://ounceoftalent.com | |
| License: GPL2 | |
| */ |
| <?php | |
| add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' ); | |
| function custom_woocommerce_get_catalog_ordering_args( $args ) { | |
| $orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); | |
| if ( 'random_list' == $orderby_value ) { | |
| $args['orderby'] = 'rand'; | |
| $args['order'] = ''; |
| function g8_aus_address( $address_types, $form_id ){ | |
| $address_types["australia"] = array( | |
| "label" => "Australian", | |
| "country" => "Australia", | |
| "zip_label" => "Postcode", | |
| "state_label" => "State", | |
| "states" => array( | |
| "NT" => "NT", | |
| "ACT" => "ACT", | |
| "NSW" => "NSW", |
| <?php | |
| add_filter( 'nav_menu_css_class', 'je_portfolio_menu_item_classes', 10, 2 ); | |
| /** | |
| * Add css classes to Portfolio CPT menu item, remove from Blog item | |
| * | |
| * Enables menu classes for CPTs. | |
| * Pretty fragile, as it depends on the item titles for each menu item, change as required | |
| * | |
| * @param array $classes CSS classes for the menu item |