Tags op pagina’s
vrijdag, 18 april 2014
Gebruik onderstaande code om tags te gaan gebruiken op pagina’s, plaats deze code in de file functions.php in je template directory. // add tag support to pages function tags_support_all() { register_taxonomy_for_object_type('post_tag', 'page'); } // ensure all tags are included in queries function tags_support_query($wp_query) { if ($wp_query->get('tag')) $wp_query->set('post_type', 'any'); } // tag
- Categorie Hacks
No Comments
Intelligent the_excerpt gebruiken, met hele zinnen
woensdag, 16 april 2014
Intelligente manier van the_excerpt // Variable & intelligent excerpt length. function print_excerpt($length) { // Max excerpt length. Length is set in characters global $post; $text = $post->post_excerpt; if ( '' == $text ) { $text = get_the_content(''); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); } $text = strip_shortcodes($text); // optional, recommended $text =
- Categorie Hacks