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
| # Block access to WordPress specific files | |
| <files .htaccess> | |
| Order allow,deny | |
| Deny from all | |
| </files> | |
| <files readme.html> | |
| Order allow,deny | |
| Deny from all | |
| </files> | |
| <files readme.txt> |
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
| {% if template contains 'product' %} | |
| <meta property="og:type" content="product"> | |
| <meta property="og:title" content="{{ product.title | strip_html | escape }}"> | |
| <meta property="og:category" content="{{ product.type }}" /> | |
| {% for image in product.images limit:3 %} | |
| <meta property="og:image" content="http:{{ image.src | product_img_url: 'master' }}"> | |
| <meta property="og:image:secure_url" content="https:{{ image.src | product_img_url: 'master' }}"> | |
| {% endfor %} | |
| <meta property="og:price:amount" content="{{ product.price | money_without_currency | stip_html | escape | remove: ',' }}"> | |
| <meta property="og:price:currency" content="{{ shop.currency }}"> |
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 | |
| $file = '/path/to/file.png'; | |
| $filename = basename($file); | |
| $upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
| if (!$upload_file['error']) { | |
| $wp_filetype = wp_check_filetype($filename, null ); | |
| $attachment = array( | |
| 'post_mime_type' => $wp_filetype['type'], | |
| 'post_parent' => $parent_post_id, |
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
| /** | |
| * Real-World CSS | |
| * by @visualidiot. Licensed under WTPFL. | |
| */ | |
| /* @group Blink */ | |
| .blink { | |
| -webkit-animation: blink .75s linear infinite; | |
| -moz-animation: blink .75s linear infinite; |
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 | |
| // Create array | |
| $a = array(); | |
| // Add an item to it | |
| $a[] = 1; | |
| // Point to the last index of the array | |
| end( $a ); |
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
| /** | |
| * Wrapper around get_posts that utilizes object caching | |
| * | |
| * @access public | |
| * @param mixed $args (default: NUL) | |
| * @param bool $force_refresh (default: false) | |
| * @return void | |
| */ | |
| function get_posts_cached( $args = NULL, $force_refresh = false ) { | |
| $cache_incrementor = wp_cache_get( 'get_posts_cached', 'cache_incrementors' ); |
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 | |
| /** | |
| * [list_searcheable_acf list all the custom fields we want to include in our search query] | |
| * @return [array] [list of custom fields] | |
| */ | |
| function list_searcheable_acf(){ | |
| $list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
| return $list_searcheable_acf; | |
| } |
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 | |
| /** | |
| * Given an ordered array of comparison functions, return one function that | |
| * starts with the first and uses the subsequent functions in order in the | |
| * event of equal items. | |
| * | |
| * @param $sortFnArr | |
| * @param int $index | |
| * @return callable |
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
| # Welcome to your htaccess file. | |
| # Remember that modifying this file can break the entire website | |
| # so please edit carefully. | |
| # Also remember that the order of the rules below does matter, | |
| # so be sure of what you're doing before shuffling things around. | |
| AuthType Basic | |
| AuthName "My Dev Environment" | |
| # Specify what user/password file the server should look |
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 | |
| if ( is_singular('product') ) { | |
| global $post; | |
| // get categories | |
| $terms = wp_get_post_terms( $post->ID, 'product_cat' ); | |
| foreach ( $terms as $term ) $cats_array[] = $term->term_id; |