Viktiga modifieringar - Grupp4-LNU/musiklararportalen GitHub Wiki
Gör så man bara får en summering när inlägg listas! (istället för att hela inlägget visas när man tex klickar på artiklar el nyheter)
Om något är oklart så läs mer här: http://codex.wordpress.org/Function_Reference/the_excerpt
ÄNDRINGAR I KODEN PÅ SEARCH OCH INDEX.PHP I BP-PORTALEN mkniped->wordpress->wp-content->themes->bp-portalen->search.php
RAD 35:
<div class="entry">
<?php
if ( is_search() ) {
the_excerpt();
} else {
the_content( __( 'Read the rest of this entry ?', 'buddypress' ) );
}
?>
wordpress->wp-content->themes->bp-portalen->index.php RAD 37:
<?php
if ( is_home() ) {
the_excerpt();
} else {
the_content( __( 'Read the rest of this entry ?', 'buddypress' ) );
}
?>
För att ändra hur många tecken excerpt(hur lång sammanfattningen ska vara) ska ha får man skapa functions.php och lägga i themes - > buddypress. Om man vill har read more länk tex Mer…. så läggs den också in där enligt nedan.
<?php
function custom_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function new_excerpt_more($more) {
global $post;
return ' <a href="'. get_permalink($post->ID) . '">Mer...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
?>