This file contains hidden or 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 gameaccess_acf_date( $id, $field ) { | |
$meta_value = get_post_meta( $id , $field, true ); | |
echo date_i18n( 'F d, Y' , strtotime( $meta_value ) ); | |
} | |
?> |
This file contains hidden or 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 | |
$meta_value = get_post_meta( get_the_ID() , 'acf_date', true ); | |
$date = date_i18n( 'd M Y' , strtotime( $meta_value ) ); | |
?> |
This file contains hidden or 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 rrwd_has_post_youtube( $post_id ) { | |
if ( !function_exists( 'get_field') ) | |
return; | |
if ( get_field( 'acf_youtube', $post_id ) ) { | |
echo '<iframe class="frame-youtube" src="http://www.youtube.com/embed/'. get_field( 'acf_youtube') . '?feature=oembed" name="youtube" frameborder="0" allowfullscreen></iframe>' . "\n"; |
This file contains hidden or 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_filter( 'theme_page_templates', 'rrwd_remove_page_template' ); | |
function rrwd_remove_page_template( $pages_templates ) { | |
unset( $pages_templates['page_blog.php'] ); | |
unset( $pages_templates['page_archive.php'] ); | |
return $pages_templates; | |
} | |
?> |
This file contains hidden or 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
<a href="https://twitter.com/RianRietveld"><img src="[email protected]" alt="Follow me on Twitter"></a> |
This file contains hidden or 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 | |
/** | |
* Home Slider | |
* | |
* Uses the Genesis Responsive slider combined with Advanaced Custom Fields | |
* setting in Dashboard - Instellingen website | |
*/ | |
function rrwd_home_slider() { | |
global $wpdb; |
This file contains hidden or 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 | |
/** | |
* Change Upload Directory for one Custom Post-Type | |
* | |
* This will change the upload directory for a custom post-type. Attachments for this custom post type will | |
* now be uploaded to a seperate "uploads" directory. Make | |
* sure you swap out "post-type" and the "my-dir" with the appropriate values... | |
* credits to: http://wordpress.stackexchange.com/users/4044/jhdenham | |
* and http://yoast.com/smarter-upload-handling-wp-plugins/ | |
*/ |
This file contains hidden or 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_filter( 'pre_get_posts', 'rrwd_filter_posts' ); | |
function rrwd_filter_posts( $query ) { | |
if( !is_user_logged_in() ) { | |
$meta_query = array( | |
array( | |
'key' => '_members_access_role', | |
'compare' => 'NOT EXISTS' | |
) | |
); |
This file contains hidden or 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 | |
// default thumbnail | |
add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 ); | |
function my_post_image_html( $html, $post_id, $post_image_id ) { | |
if( '' == $html ) | |
$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '"><img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/default-afbeelding.jpg" class="alignleft wp-post-image" alt="'.get_post_field( 'post_title', $post_id ).'"></a>'; | |
else | |
$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>'; | |
return $html; | |
} |