WordPress archive

Adding the excerpt function to WordPress pages

The excerpt function that is so useful in WordPress posts, does not come as standard on pages. Luckily, the fix is easy. Add the following code to your functions.php file and voila! Excerpts on wordpress pages. // add excerpts to pages function add_page_excerpt_meta_box() { add_meta_box( ‘postexcerpt’, __(‘Excerpt’), ‘post_excerpt_meta_box’, ‘page’, ‘normal’, ‘core’ ); } add_action( ‘admin_menu’, […]

Tags: , , ,

Sorting WordPress Posts Using Surnames

A client recently requested that their ‘Members’ page be sorted by surname and not first name. The lists were generated using the follwing code: <?php$cat_args = array( ‘sort_column’ => ‘post_title’, ‘order’ => ‘ASC’, ‘parent’ => 12); $categories =   get_categories($cat_args); foreach($categories as $category) { echo ‘<ul id=”member”><li><h3>’ . $category->name.'</h3></li>’; $post_args = array( ‘numberposts’ => 50, […]

Tags: , ,