Skip to content

Instantly share code, notes, and snippets.

View derweili's full-sized avatar

Julian Weiland derweili

  • Germany
  • 05:27 (UTC +02:00)
View GitHub Profile
@derweili
derweili / orbit-wp-gallery.php
Created September 5, 2016 15:13
WordPress Gallery based on Zurb Foundation Orbit Carousel
@derweili
derweili / pregetposts_postnumber_filter.php
Last active May 11, 2016 08:34
Modify main query pased on taxonomy - wordpress
function derweili_change_postnumber_imagegallerycat( $query ) {
if ( $query->is_main_query() && $query->is_tax('bildergalerien-kategorie') ) {
$query->set('posts_per_page', 50);
return;
}
}
add_action( 'pre_get_posts', 'derweili_change_postnumber_imagegallerycat' );
@derweili
derweili / selena-add-author-child-functions.php
Created March 1, 2016 22:50
Code to add the author to the meta function of the sela wordpress theme. Answer for forum topic on wordpress.org https://wordpress.org/support/topic/meta_data-add-author-in-frontend?replies=1
if ( ! function_exists( 'sela_entry_meta' ) ) :
function sela_entry_meta() {
// Sticky
if ( is_sticky() && is_home() && ! is_paged() ) {
echo '<span class="featured-post">' . __( 'Featured', 'sela' ) . '</span>';
}
echo '<a href="' . get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) . '">' . get_the_author() . '</a>';