WordPress: WooCommerce: Add a custom currency / symbol


To add a custom currency paste this code in your theme functions.php file or in a complementary plugin for WooCommerce and swap out the currency code and symbol with your own. After doing so it will be available from WooCommerce settings. add_filter( 'woocommerce_currencies', 'add_my_currency' ); function add_my_currency( $currencies ) { $currencies['ABC'] = __( 'Currency name', 'woocommerce' ); return … Continue reading WordPress: WooCommerce: Add a custom currency / symbol

WordPress: WooCommerce plugin: How to Override WooCommerce Template File Within a Plugin


Override WooCommerce Template File Within a Plugin The goal of this article is to describe one approach to overriding WooCommerce core template files within a custom plugin, such that they can still beoverridden by a theme in the typical way. Note that this is similar to but solves a slightly different problem than what we did to create a custom … Continue reading WordPress: WooCommerce plugin: How to Override WooCommerce Template File Within a Plugin

WordPress: Using WP_Query Arguments


<?php /** * WordPress Query Comprehensive Reference * Compiled by luetkemj - luetkemj.com * * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query * Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php */ $args = array( //////Author Parameters - Show posts associated with certain author. 'author' => 1,2,3, //(int) - use author id [use minus (-) to exclude authors by ID ex. 'author' => -1,-2,-3,] 'author_name' => … Continue reading WordPress: Using WP_Query Arguments

Get the sources of img tags from html


/** * get the sources of img tags from html input parameter */ function get_html_img_sources($html){ //$html = types_render_field( "gallery_image", array( "size" => "medium", "proportional" => "true",'output'=>'raw') ); if(empty($html)) return array(); $doc = new DOMDocument(); $doc->loadHTML($html); $imageTags = $doc->getElementsByTagName('img'); $img_src_arr = array(); foreach($imageTags as $tag) { $img_src_arr[] = get_site_url().'/'.substr( $tag->getAttribute('src'), strrpos( $tag->getAttribute('src'), '/wp-content' )+1 ); } … Continue reading Get the sources of img tags from html