How To Remove Posts And Pages Columns In WordPress
Adding the following snippet will let you remove posts and pages columns in WordPress.
For Posts Columns
1 2 3 4 5 6 7 |
<?php function remove_post_columns($defaults) { unset($defaults['comments']); return $defaults; } add_filter('manage_posts_columns', 'remove_post_columns'); ?> |
Snippet Source/Credit: WP-Snippets.com
For Pages Columns
1 2 3 4 5 6 7 |
<?php function remove_pages_columns($defaults) { unset($defaults['comments']); return $defaults; } add_filter('manage_pages_columns', 'remove_pages_columns'); ?> |
Snippet Source/Credit: WP-Snippets.com
How To Reset Your Password In WordPress
The following snippet will let you reset your password in WordPress.
1 |
UPDATE `wp_users` SET `user_pass` = MD5('NEW_PASSWORD') WHERE `wp_users`.`user_login` =`YOUR_USER_NAME` LIMIT 1; |
Snippet Source/Credit: WP-Snippets.com
How To Separate Trackbacks In WordPress
Adding the following snippet will let you separate trackbacks in WordPress.
1 2 3 4 5 6 |
<?php // Find: foreach ($comments as $comment) : // Comments are displayed here endforeach; ?> |
Snippet Source/Credit: WPRecipes.com
How To Shorten The Excerpt In WordPress
The following snippet will let you shorten the excerpt in WordPress.
1 2 3 4 5 6 |
<?php function new_excerpt_length($length) { return 20; } add_filter('excerpt_length', 'new_excerpt_length'); ?> |
Snippet Source/Credit: WP-Snippets.com
How To Show Images From Post Or Page Attachments In WordPress
The following snippet will let you show images from post or page attachments in WordPress.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<?php $argsThumb = array( 'order' => 'ASC', 'post_type' => 'attachment', 'post_parent' => $post->ID, 'post_mime_type' => 'image', 'post_status' => null ); $attachments = get_posts($argsThumb); if ($attachments) { foreach ($attachments as $attachment) { //echo apply_filters('the_title', $attachment->post_title); echo '<img src="'.wp_get_attachment_url($attachment->ID, 'thumbnail', false, false).'" />'; } } ?> |
Snippet Source/Credit: WP-Snippets.com