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
/** | |
* WordPress Genesis Accessible skip links for screen readers and keyboard users | |
* Rian Rietveld - rrwd.nl | |
* Add this to style.css in the child theme for the Genesis Framework by StudioPress. | |
* The skip links are dependent on the selected page layout | |
*/ | |
a.skip-link { | |
background-color: #f2f9ff; |
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
.prefix-hidden { | |
background-color: #fff; | |
border: 1px solid #000; | |
display: block; | |
font-size: 1em; | |
left: -1000em; | |
padding: 0.8em; | |
position: absolute; | |
z-index: 10; | |
} |
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 | |
/** | |
* This code adds a costom post type with it's own taxonomy to WordPress | |
* And adds an archive option to show the posts ordered by taxonomy name | |
* Rian Rietveld - rrwd.nl | |
* November 22, 2012 | |
* Add this to the functions.php in your WordPress child theme | |
* Here, as an example, the custom post type is book and the taxonony is genre | |
*/ |
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 | |
/** | |
* This code saves an extra custom post field with a custom post type to WordPress | |
* Rian Rietveld - rrwd.nl | |
* Add this to the functions.php in your WordPress child theme | |
* | |
* Adding the priority 20 for the add_action to save_post is !important, otherwise it won't work | |
*/ | |
function rrwd_save_cpf_with_ctp ( $post_id, $post ) { |
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; | |
} |
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 | |
/** | |
* 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
<?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
<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 | |
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; | |
} | |
?> |
OlderNewer