Skip to content

Instantly share code, notes, and snippets.

View trys's full-sized avatar
🤓
🚀

Trys Mudford trys

🤓
🚀
View GitHub Profile
@trys
trys / one.php
Created December 3, 2014 10:22
Problem One
$total = 0;
for ( $i = 0; $i < 1000; $i++ )
$total += $i % 5 === 0 || $i % 3 === 0 ? $i : 0;
echo $total;
@trys
trys / gist:5ce5c48dc98eadc6680b
Created October 30, 2014 15:30
WordPress TinyMCE - refresh
$( '.wp-editor-wrap' ).each( function () {
var id = $( this ).parent().data( 'id' );
tinyMCE.get( id ).remove();
switchEditors.go( id , 'tmce' );
});
@trys
trys / gist:35583becde541a2a8325
Created September 5, 2014 15:44
WP Query - Reference
<?php
$args = array(
'post_type' => 'post'
);
$post_query = new WP_Query( $args );
if ( $post_query->have_posts() ) {
while ( $post_query->have_posts() ) {
$post_query->the_post();
get_template_part( 'content', get_post_type() );
}