KLoning Spoon

The admin pages listing the site’s posts and pages come with various text columns (title, tags, categories, author and so on). In order to see what the featured images are, you have to visit each post or page individually. What I will show here, is how to get add a column with a reasonably sized thumbnail copy of the featured image. Please note that this only works for themes that support featured images.

Add a new image size

First we add a new image size. Full details for this function are found on the WordPress add_image_size() codex page.

add_image_size( 'admin-list-thumb', 100, 100, false );

If your theme already has a 100 x 100 image size, you can skip this step. If not, then you may end up with an image size that messes up the layout of the columns.

Add featured image column

Next up, we add the featured image column to the posts and pages list view and pull in the featured image itself using our newly defined image size.

// Dummy up theme support.
//add_theme_support( 'post-thumbnails' );

// Add the posts and pages columns filter. They can both use the same function.
add_filter('manage_posts_columns', 'tcb_add_post_thumbnail_column', 5);
add_filter('manage_pages_columns', 'tcb_add_post_thumbnail_column', 5);

// Add the column
function tcb_add_post_thumbnail_column($cols){
  $cols['tcb_post_thumb'] = __('Featured');
  return $cols;
}

// Hook into the posts an pages column managing. Sharing function callback again.
add_action('manage_posts_custom_column', 'tcb_display_post_thumbnail_column', 5, 2);
add_action('manage_pages_custom_column', 'tcb_display_post_thumbnail_column', 5, 2);

// Grab featured-thumbnail size post thumbnail and display it.
function tcb_display_post_thumbnail_column($col, $id){
  switch($col){
    case 'tcb_post_thumb':
      if( function_exists('the_post_thumbnail') )
        echo the_post_thumbnail( 'admin-list-thumb' );
      else
        echo 'Not supported in theme';
      break;
  }
}

Just copy code above to your functions.php and here the preview of result.

Just write this function to your functions.php file and change the home_url() in this code to your new url.

function new_login_redirect_url() {

  return home_url();
}
add_filter('login_redirect', 'new_login_redirect_url');

remove_action( $tag, $function_to_add, $priority, $accepted_args );

This function removes a function attached to a specified action hook. This method can be used to remove default functions attached to a specific action hook and possibly replace them with a substitute.

Important: To remove a hook, the $function_to_remove and $priority arguments must match when the hook was added. This goes for both filters and actions. No warning will be given on removal failure.
via: WP Codexy

The following syntax shows an excerpt, only a part of the output you can have in your theme. They result from the standard functions, which are loaded in the head of the theme. Visible, if you search in the file wp-includes/default-filters.php for the Hook wp_head. Not all filters should be deactivated, because in most cases they are useful. But WordPress is not only as classical blog in use and therefore some functions are not necessary.

    <link rel="alternate" type="application/rss+xml" title="WP Engineer RSS Feed" href="http://wpengineer.com/feed/" />
    <link rel="alternate" type="application/atom+xml" title="WP Engineer Atom Feed" href="http://wpengineer.com/feed/atom/" />
    <link rel="pingback" href="http://wpengineer.com/blog/xmlrpc.php" />
    <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://wpengineer.com/xmlrpc.php?rsd" />
    <link rel='index' title='WP Engineer' href='http://wpengineer.com' />
    <link rel='start' title='Use WordPress 2.7 Offline' href='http://wpengineer.com/use-wordpress-27-offline/' />
    <link rel='prev' title='Recents Drafts All Authors' href='http://wpengineer.com/recents-drafts-all-authors/' />

This is an example, not a recommendation where some functions are deactivated. Check your header and turn off what you don’t need. Less markup and better loading time.

    remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds
    remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed
    remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link
    remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file.
    remove_action( 'wp_head', 'index_rel_link' ); // index link
    remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // prev link
    remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link
    remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Display relational links for the posts adjacent to the current post.
    remove_action( 'wp_head', 'wp_generator' ); // Display the XHTML generator that is generated on the wp_head hook, WP version

source: wpengineer

Ever thought you could make some improvements to your RSS feed? Like letting it cover more (or less!) content? Or adding some extra details onto the end of your posts?

All of this is going to take place in the functions.php file of your theme. If your theme doesn’t have one, just create a file in your theme’s folder with that name and let’s get to it! (Make sure all of this code goes between the opening tag in the file)

<?php if (function_exists('related_posts')) {related_posts(); }?>

If you are serious about blogging and want to expand your reach as far as possible, error codes will not help you. Use the if (function_exists) call when adding plugins to your WordPress theme… you’ll thank yourself if you ever run into trouble.

The WordPress function wp_get_archives(‘type=postbypost’) displays a lovely list of posts, but won’t show the date of each post. This plugin adds each post’s date to those ‘postbypost’ lists