A list of items that contain a thumbnail image and a block of text, which could be as simple as a headline, but could also contain sub-text or calls to action.
A Pen by Brad Frost on CodePen.
| $("form :input, form textarea, form select").each(function(index, elem) { | |
| var eId = $(elem).attr("id"); | |
| if(eId && (label = $(elem).parents("form").find("label[for="+eId+"]")).length == 1){ | |
| if($(elem).prop('tagName') == 'SELECT'){ | |
| // if it's a dropdown, change the first item ('All') to be the label | |
| $(elem).find('option:first').text('- '+$(label).text()+' -'); | |
| }else{ | |
| if ($(elem).is(':checkbox') || $(elem).is(':radio')) { | |
| // if it's a checkbox or radio, don't change anything |
| <?php | |
| /* | |
| * In this example, we will load a textarea field from the options page (textarea field is called my_select_values) | |
| * and use the text on each line as a option for the select field’s choices. The select field in this example has a name of “color”. | |
| * Note: This is example 1 of 2 | |
| * | |
| * Source: http://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/ | |
| * | |
| * Add to your functions.php | |
| */ |
| <?php | |
| /** | |
| * Given a URL, normalize that URL. | |
| * @param String URL | |
| * @return String Normalized URL | |
| */ | |
| function normalizeUrl($url) | |
| { | |
| $newUrl = ""; | |
| $url = parse_url($url); |
| class Text_Editor_Custom_Control extends WP_Customize_Control | |
| { | |
| public $type = 'textarea'; | |
| /** | |
| ** Render the content on the theme customizer page | |
| */ | |
| public function render_content() { ?> | |
| <label> | |
| <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> | |
| <?php |
| <?php | |
| add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | |
| function custom_override_checkout_fields( $fields ) { | |
| unset($fields['billing']['billing_company']); | |
| unset($fields['billing']['billing_address_1']); | |
| unset($fields['billing']['billing_address_2']); | |
| unset($fields['billing']['billing_city']); | |
| unset($fields['billing']['billing_postcode']); | |
| unset($fields['billing']['billing_country']); | |
| unset($fields['billing']['billing_state']); |
| # ----------------------------------------------------------------- | |
| # .gitignore for WordPress @salcode | |
| # ver 20180808 | |
| # | |
| # From the root of your project run | |
| # curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
| # to download this file | |
| # | |
| # By default all files are ignored. You'll need to whitelist | |
| # any mu-plugins, plugins, or themes you want to include in the repo. |
| /* arrow fades in and out, use for a 'scroll down' indicator for example */ | |
| #godown { | |
| position:absolute; | |
| bottom:20px; | |
| left:50%; | |
| margin-left:-10px; | |
| width:20px;height:20px; | |
| display:block; | |
| transform: rotate(45deg) ; | |
| -webkit-transform: rotate(45deg) ; |
| #!/bin/env sh | |
| lines=$(tput lines) | |
| cols=$(tput cols) | |
| awkscript=' | |
| { | |
| letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()" | |
| lines=$1 |
A list of items that contain a thumbnail image and a block of text, which could be as simple as a headline, but could also contain sub-text or calls to action.
A Pen by Brad Frost on CodePen.
| #!/bin/bash | |
| # node-reinstall | |
| # credit: http://stackoverflow.com/a/11178106/2083544 | |
| ## program version | |
| VERSION="0.0.13" | |
| ## path prefix | |
| PREFIX="${PREFIX:-/usr/local}" |