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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
function featuredtoRSS($content) { | |
global $post; | |
if ( has_post_thumbnail( $post->ID ) ){ | |
$content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content; | |
} | |
return $content; | |
} | |
add_filter('the_excerpt_rss', 'featuredtoRSS'); | |
add_filter('the_content_feed', 'featuredtoRSS'); |
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
// register custom post type to work with | |
function lc_create_post_type() { | |
// set up labels | |
$labels = array ( | |
'name' => 'Events', | |
'singular_name' => 'Event', | |
'add_new' => 'Add New Event', | |
'add_new_item' => 'Add New Event', | |
'edit_item' => 'Edit Event', | |
'new_item' => 'New Event', |
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_enqueue_scripts','tu_remove_google_fonts', 10 ); | |
function tu_remove_google_fonts() { | |
wp_dequeue_style( 'generate-fonts' ); | |
} |
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
.site-logo img { | |
width: 155px; | |
} |
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
function wpseo_cdn_filter( $uri ) { | |
return str_replace( 'https://domain.com', 'https://cdn.domain.com', $uri ); | |
} | |
add_filter( 'wpseo_xml_sitemap_img_src', 'wpseo_cdn_filter' ); |
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
//adds custom post type query var to preview links | |
function mycptname_cpt_previow_query_vars($link, $post) { | |
$custom_post_types = array('artist'); | |
if(in_array($post->post_type, $custom_post_types)) { | |
return add_query_arg(['post_type' => $post->post_type], $link); | |
} | |
return $link; | |
} | |
add_filter('preview_post_link', 'mycptname_cpt_previow_query_vars', 10, 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
'show_in_rest' => true, |
OlderNewer