- install dnsmasq
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
- edit
/usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
| <?php if( have_rows('billboard') ): ?> | |
| <div class="billboard"> | |
| <?php while( have_rows('billboard') ): the_row(); | |
| $imageArray = get_sub_field('image'); | |
| $imageURL = $imageArray['url']; | |
| ?> | |
| <div class="slide-item" style="background-image: url('<?php echo $imageURL;?>');" > | |
| <h1><?php the_sub_field('title'); ?></h1> | |
| </div> |
| <?php | |
| //My ACF Fields for reference | |
| //testimonials - field group | |
| //testimonial - sub-field | |
| //testimonial_header - sub-field | |
| //First Repeater Row in Array | |
| $rows = get_field( 'testimonials', 348 );// grab all rows from page ID |
| (function($) { | |
| /* | |
| * new_map | |
| * | |
| * This function will render a Google Map onto the selected jQuery element | |
| * | |
| * @type function | |
| * @date 8/11/2013 | |
| * @since 4.3.0 |
| global $post; | |
| $terms = get_the_terms( $post->ID, 'product_cat' ); | |
| foreach ( $terms as $term ) { | |
| $product_cat_id = $term->term_id; | |
| echo $product_cat_id; | |
| break; | |
| } |
| read -r -p "Would you really like to reset your development database and pull the latest from production? [y/N] " response | |
| if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]] | |
| then | |
| wp @development db reset --yes | |
| wp @production db export - > sql-dump-production.sql | |
| wp @development db import sql-dump-production.sql | |
| wp @development search-replace https://example.com https://example.dev | |
| else | |
| exit 0 | |
| fi |
| add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' ); | |
| /** | |
| * custom_woocommerce_template_loop_add_to_cart | |
| */ | |
| function custom_woocommerce_product_add_to_cart_text() { | |
| global $product; | |
| $product_type = $product->product_type; | |
| switch ( $product_type ) { |
| add_action('add_attachment', 'create_post'); | |
| function create_post( $attach_ID ) { | |
| $attachment = get_post( $attach_ID ); | |
| $my_post_data = array( | |
| 'post_title' => $attachment->post_title, | |
| 'post_type' => 'dmc-photo', | |
| 'post_category' => array('0'), | |
| 'post_status' => 'publish' |
| # font color : green | |
| color='\e[0;32m' | |
| # font color : white | |
| NC='\e[0m' | |
| getquote(){ | |
| num_online_quotes=9999 | |
| rand_online=$[ ( $RANDOM % $num_online_quotes ) + 1 ] | |
| quote=$(wget -q -O - "http://www.quotationspage.com/quote/$rand_online.html" | |
| # wp-cli alias to push a local WP database to a staging site | |
| pushstage() { | |
| START=$(date +%s) | |
| # make a backup of the current local database | |
| # get current directory name, used for database and URL | |
| current=${PWD##*/} | |
| wp db export $current.sql | |
| # rsync the local database to staging site | |
| rsync $current.sql $current-s:~/ | |
| # get the staging site URL for search replace |
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
/usr/local/etc/dnsmasq.confaddress=/local/127.0.0.1