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 | |
// query args generated | |
return [ | |
"post_type" => [ | |
"cases" | |
], | |
"post_status" => [ | |
"publish" | |
], |
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
{ | |
"query_args": { | |
"post_type": [ | |
"post" | |
], | |
"post_status": [ | |
"publish", | |
"acf-disabled" | |
], | |
"author": "2", |
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_action( 'admin_menu', 'add_wp_blocks_to_menu' ); | |
function add_wp_blocks_to_menu(){ | |
global $menu; | |
add_menu_page( 'global_blocks', 'Global Blocks', 'read', 'wp_block', '', 'dashicons-align-right', 1 ); | |
$menu[1][2] = "/wp-admin/edit.php?post_type=wp_block"; | |
} | |
// https://indiyoung.wpengine.com/wp-admin/edit.php?post_type=wp_block |
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 | |
// check default image sizes | |
print_r( get_intermediate_image_sizes() ); | |
// check registered image sizes | |
global $_wp_additional_image_sizes; | |
print_r( $_wp_additional_image_sizes ); ?> |
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_action('wp_head','ifjt_meta_domain_verify'); | |
function ifjt_meta_domain_verify() { | |
?> | |
<meta name="facebook-domain-verification" content="67up5r2pygsmvi3sjhya25ab6m0jg3" /> | |
// replace this line with a meta verification code | |
<?php | |
} |
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
CASE | |
WHEN ( CONTAINS_TEXT(Source / Medium, "(direct) / (none)") OR CONTAINS_TEXT(Source / Medium, "none") ) THEN "Direct" | |
WHEN ( CONTAINS_TEXT(Campaign,"email") OR CONTAINS_TEXT(Source / Medium, "email") ) THEN "Email" | |
WHEN ( CONTAINS_TEXT(Source / Medium,"affiliate") OR CONTAINS_TEXT(Source / Medium, "shareasale") ) THEN "Affiliates" | |
WHEN ( CONTAINS_TEXT(Source / Medium,"display") OR CONTAINS_TEXT(Source / Medium, "taboola") ) THEN "Display Ads" | |
WHEN ( CONTAINS_TEXT(Source / Medium,"organic") OR CONTAINS_TEXT(Source / Medium, "baidu") ) THEN "Organic Search" | |
WHEN ( CONTAINS_TEXT(Source / Medium,"google / cpc") OR | |
CONTAINS_TEXT(Source / Medium, "adwords") OR | |
CONTAINS_TEXT(Source / Medium, "googleadservices.com / referral") OR | |
CONTAINS_TEXT(Source / Medium, "Google / Ad") |
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 | |
add_action( 'admin_menu', 'add_wp_blocks_to_menu' ); | |
function add_wp_blocks_to_menu(){ | |
global $menu; | |
add_menu_page( 'global_blocks', 'Global Blocks', 'read', 'wp_block', '', 'dashicons-align-right', 1 ); | |
$menu[1][2] = "/wp-admin/edit.php?post_type=wp_block"; | |
} |
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
// Remove all class attributes and contents from divs in the DOM | |
var myDivs = document.getElementsByTagName('div'); // replace div with span for spans | |
for (var i = 0; i < myDivs.length; i++) { | |
myDivs[i].removeAttribute('class'); // replace class with any attribute you want stripped out | |
} | |
// Remove all SVGs from the DOM | |
var collectSvg = document.getElementsByTagName('svg'); | |
for (var i = 0; i < collectSvg.length; i++) { | |
collectSvg[i].parentNode.removeChild(collectSvg[i]); |
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
-- this would remove the following string including a trailing space: [PMC Daily Insight] | |
UPDATE wp_posts | |
SET post_title = | |
MID( post_title, LENGTH('[PMC Daily Insight] ')+1 ) | |
WHERE post_title LIKE '[PMC Daily Insight] %' | |
AND post_type = 'post'; |
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 | |
// prepend a call to action to your email body by adding before your the_content() | |
function prepend_rss_cta($content) { | |
$cta = ' <p><i>Want to share or link to this post? It lives here: <a href="' . get_the_permalink( get_the_ID() ). '">' . get_the_title( get_the_ID() ) . '</a>.</i></p>'; | |
$content = $cta . $content; // switch cta and content to append (not prepend) your CTA | |
return $content; | |
} | |
add_filter('the_content_feed', 'prepend_rss_cta'); |
NewerOlder