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 | |
/** | |
* Use an HTML Email Template for All Sends | |
* Add this file to functions.php | |
*/ | |
function your_email_template($args) { | |
if (!is_array($args)) { | |
return $args; |
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
$number = 20; | |
if ($number % 2 == 0) { | |
print "It's even"; | |
} |
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
# Editor Settings | |
(Settings > Editor) | |
Enable Soft Wrap (so that you do not have to scroll left) | |
Set tab length to 4 | |
# Packages | |
* = Most useful |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;UTF-8" /> | |
<style> | |
a { | |
color: #00b3be; | |
} | |
</style> | |
</head> |
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 if( have_rows('repeater_field_name') ): // check if the repeater field has rows of data ?> | |
<?php while ( have_rows('repeater_field_name') ) : the_row(); // loop through the rows of data ?> | |
<?php the_sub_field('sub_field_name'); // display a sub field value ?> | |
<?php endwhile; ?> | |
<?php endif; ?> |
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
// Add text to featured image meta box | |
add_filter( 'admin_post_thumbnail_html', 'mytheme_featured_image_instruction'); | |
function mytheme_featured_image_instruction( $content ) { | |
return $content .= '<p>Optimal size is 1410 x 260 pixels.</p>'; | |
} |
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
// Move Yoast SEO Metabox to the bottom of the posts screen | |
add_filter( 'wpseo_metabox_prio', function() { return 'low';}); |
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
if(window.location.hash) { | |
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character | |
alert (hash); | |
// hash found | |
} else { | |
// No hash found | |
} |
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
# Delete all unapproved comments | |
DELETE FROM wp_comments WHERE comment_approved = 0 | |
# Test to see what pages are using a certain page template | |
SELECT * FROM `wp_postmeta` WHERE `meta_value` like 'page-library.php' | |
# Get a post by ID | |
SELECT * FROM `wp_posts` WHERE `ID` = 1128 |
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
SELECT * FROM `wp_postmeta` WHERE `meta_value` like 'page-library.php' |
NewerOlder