O'Reilly logo

Beginning WordPress 3 by Stephanie Leary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Theme Functions

This sample theme functions file includes many of the tricks shown throughout this book. Save it as functions.php in your theme directory, or copy the features you need into your existing theme functions file.

<?php /* Theme Functions */ // Removing the meta generator tag // (Chapter 11, Performance and Security) remove_action('wp_head', 'wp_generator'); // Changing excerpt length // (Chapter 6, Basic Themes) function change_excerpt_length($length) { return 100; } add_filter('excerpt_length', 'change_excerpt_length'); // Changing excerpt more // (Chapter 6, Basic Themes) function change_excerpt_more($more) { return '...'; } add_filter('excerpt_more', 'change_excerpt_more'); // Add excerpts to pages // (Chapter 12, Custom ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required