This file contains 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 | |
/** | |
* Loop through an order's items and see if there's a free trial set | |
* | |
* @param WC_Order $order | |
* @return bool|WP_Error | |
*/ | |
function custom_order_has_trial( $order ) { | |
if ( ! $order instanceof WC_Order ) |
This file contains 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
# ignore everything in the root except the "wp-content" directory.* | |
/* | |
!wp-content/ | |
# ignore everything in the "wp-content" directory, except: | |
wp-content/* | |
!wp-content/plugins/ | |
!wp-content/themes/ | |
!wp-content/mu-plugins/ | |
# ignore all files starting with . or ~ | |
.* |
This file contains 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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
This file contains 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
$all_posts = $wpdb->get_results(" | |
SELECT wp_posts.ID,wp_posts.post_date,wp_posts.post_title,wp_posts.post_name, | |
wp_terms.name,wp_terms.slug,wp_term_taxonomy.description | |
from wp_posts | |
join wp_term_relationships on wp_posts.ID = wp_term_relationships.object_id | |
join wp_terms on wp_term_relationships.term_taxonomy_id = wp_terms.term_id | |
join wp_term_taxonomy on wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id | |
WHERE wp_posts.post_status = 'publish' | |
ORDER BY wp_terms.slug,wp_posts.ID; | |
", ARRAY_A); |
This file contains 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 | |
/* | |
UPDATED: December 31, 2011. | |
Modifications: | |
- Truncated the longest country names, including: | |
-- British Indian Ocean Territories (Chagos Archipelago) -> British Indian Ocean Territories | |
-- South Georgia and the South Sandhich Islands -> South Georgia & S. Sandwich Islands |
This file contains 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
<div class="col"> | |
<ul> | |
{% set i = 1 %} | |
{% for item in post.get_field('home_what_band_bullets_section_a') %} | |
<li>{{ item.bullet_copy_text }}</li> | |
{% set i = i + 1 %} | |
{% endfor %} | |
</ul> |
This file contains 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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
This file contains 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
Often we have to add or remove files from a gitignore. In order to do so I choose to recache git and this is how I do it: | |
1. make your .gitignore changes | |
2. Recache git | |
cmd: git rm -r --cached . | |
--> this tells git to remove the cache for all your files that are currently being tracked | |
3. Add all the files to git again |
This file contains 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
#1.First create the button / CTA for the youtube video. eg. | |
<div> | |
<a href="https://www.youtube.com/embed/gUNSGk3SHhI" class="lightbox"><i class="fa fa-play fa-8 home-play-btn" aria-hidden="true" style="font-size: 4em"></i></a> | |
</div> | |
#ensure that the class "lightbox" is added. | |
#2.Add the following html at the base of the doc | |
<div id="youtubelightbox" class="parent"> | |
<div class="centeredchild"> | |
<div class="videowrapper"> |
NewerOlder