add_action( 'init', 'my_add_excerpts_to_pages' ); function my_add_excerpts_to_pages() { add_post_type_support( 'page', 'excerpt' ); }
http://www.wpbeginner.com/plugins/add-excerpts-to-your-pages-in-wordpress/
add_action( 'init', 'my_add_excerpts_to_pages' ); function my_add_excerpts_to_pages() { add_post_type_support( 'page', 'excerpt' ); }
http://www.wpbeginner.com/plugins/add-excerpts-to-your-pages-in-wordpress/
50 refers to the maximum number of characters.
/* limit characters */ add_action( 'woocommerce_after_shop_loop_item_title', 'lk_woocommerce_product_excerpt', 25); if (!function_exists('woocommerce_template_single_excerpt')) { function lk_woocommerce_product_excerpt() { $content_length = 10; global $post; $content = $post->post_excerpt; $wordarray = explode(' ', $content, $content_length + 1); if(count($wordarray) > $content_length) : array_pop($wordarray); array_push($wordarray, '...'); $content = implode(' ', $wordarray); $content = force_balance_tags($content); $content = substr($content, 0, 50); endif; echo "<div class='archive-excerpt'><p>$content<span>...</span></p></div>"; } }
Resource: http://stackoverflow.com/questions/23063730/woocommerce-product-description-length-characters
<?php the_excerpt(); ?><span><a href="<?php the_permalink(); ?>">Read More...</a></span>
Resource: http://codex.wordpress.org/Customizing_the_Read_More
Åben functions.php og ret værdien i linje 230:
function twentyten_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'twentyten_excerpt_length' );
Åben loop.php og tilføj || is_page() i8 linje 134, så det nu ser sådan her ud:
<?php if ( is_archive() || is_search() || is_page() ) : // Only display excerpts for archives and search. ?>