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 | |
/** | |
* Helper to work with Wordpress admin notices | |
* | |
* @example | |
* Notice::success('All is good!'); | |
* | |
* @example | |
* Notice::warning('Do something please.', true); |
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 | |
$countries = array( | |
'Afghanistan', | |
'Albania', | |
'Algeria', | |
'American Samoa', | |
'Andorra', | |
'Angola', | |
'Anguilla', |
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 | |
/** | |
* keeps a user always logged in | |
* don't use this on a production site, ever! | |
*/ | |
add_action( 'init', 'rkv_auto_login' ); | |
add_action( 'admin_init', 'rkv_auto_login' ); |
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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
<?php | |
/** | |
* ITS Related Links | |
* | |
* The WordPress Widget Boilerplate is an organized, maintainable boilerplate for building widgets using WordPress best practices. | |
* | |
*/ | |
class ITS_Contact_Box extends WP_Widget { |
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 | |
function rkv_child_pages( $this_page ) { | |
$args = array( | |
'fields' => 'ids', | |
'post_type' => 'work', | |
'post_parent' => $this_page, | |
'nopaging' => true, | |
'orderby' => 'menu_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
// let's go through and get the right image | |
function dg_thumb_waterfall() { | |
global $post; | |
if ( has_post_thumbnail($post->ID) ) { | |
echo '<div class="thumbnail-wrapper">'; | |
the_post_thumbnail('digi-med-thumb'); | |
echo '</div>'; |