This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /*********************************************************************************** | |
| These are examples and references for the WooCommerce Order Item meta data hooks | |
| that is displayed in the admin side of WordPress when viewing a customer's order. | |
| ***********************************************************************************/ | |
| //Do Something before the order item's meta data | |
| do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, $_product ); | |
| //Do Something after the order item's meta data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function splitStringByWords($x, $string) { | |
| //Convert the string | |
| $converted_string = explode( "\n", wordwrap( $string, $x)); | |
| //Return the array of split strings | |
| return $converted_string; | |
| } | |
| //Number of characters the split will occur after |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /***************************************************** | |
| *** Get all taxonomy terms for a post *** | |
| *****************************************************/ | |
| get_the_term_list( $post->ID, 'taxonomy_name' ); //Returns links | |
| get_the_term_list( $post->ID, 'taxonomy_name', '', ', ', '' ); //Returns links separated by commas | |
| strip_tags(get_the_term_list( $post->ID, 'taxonomy_name' )); //Returns text | |
| /***************************************************** | |
| *** Get custom fields for a post *** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function seoFriendly($string, $separator) { | |
| //Only accept dashes or underscores | |
| if( $separator == "-" || $separator == "_" ) { | |
| $separator = $separator; | |
| } else { | |
| $separator = "-"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*********************************************** | |
| Gradients | |
| ***********************************************/ | |
| @mixin gradient($from, $to) { | |
| background: -webkit-gradient(linear, left top, left bottom, from($from), to($to)); | |
| background: -moz-linear-gradient(top, $from, $to); | |
| filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}'); | |
| } | |
| //Usage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /************************************************** | |
| >> Grid << | |
| **************************************************/ | |
| .row { | |
| display: block; | |
| box-sizing: border-box; | |
| } | |
| .row:after { | |
| content: ""; | |
| display: block; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Creating the widget | |
| class wisecrab_login_widget extends WP_Widget { | |
| function __construct() { | |
| parent::__construct( | |
| // Base ID of your widget | |
| 'wisecrab_login_widget', | |
| // Widget name will appear in UI | |
| __('Log In', 'wisecrab_login_widget_domain'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Kitchen Sink</title> | |
| </head> | |
| <body> | |
| <section id="main"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <!-- Document Settings --> | |
| <meta charset="utf-8" > | |
| <!-- Responsive Settings --> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=1.0, maximum-scale=2.0"> | |
| <!-- SEO Settings --> |