By adding the following code to your functions.php you can add a link to the bottom of every post asking people to sign up to your RSS feed (of course, edit the text and you can get it to say what you want). What a great way to promote your RSS feed and gain some new subscribers…

function wps_promote_feed($content,$class = “promote”) {
echo $content
;
if (is_single()) {
?>
<div class=“<?php echo $class; ?>”>
<h3>Enjoyed this article?</h3>
<p>Please consider subscribing to our <a class=“feed” href=“<?php bloginfo(‘rss2_url’); ?>” title=“Subscribe via RSS”>RSS feed!</a></p>
</div>
<?php
}
}
add_filter
(‘the_content’,‘wps_promote_feed’);

Let me know how it goes and if you have any feedback.

By adding just one line of code to your .htaccess file you can easily change your wordpress login from yourdomain.com/wp-login.php to yourdomain.com/login/ which is much easier to remember and type (also for customers it’s easier to explain to them).

Don’t forget to backup your .htaccess file before making changes to it.

RewriteRule ^login$ http://website.com/wp-login.php [NC,L]

(Remember to change http://website.com to be your website address)

Have you seen the content lockers that require you to either tweet or like a post etc in order to view a link or a piece of information? This little hack will integrate a shortcode that hides information from people that aren’t logged in at your site.

Add this to your functions.php file …

function member( $atts, $content = null ) {
 if ( is_user_logged_in() && !is_null( $content ) && !is_feed() ) {
 return $content;
 return '';
 } else {
 
 $yonlendir = get_permalink();
 $form = wp_login_form(array('echo' => false, 'redirect' => $yonlendir ));
 return $form;
 }
}
add_shortcode( 'mem', 'member' );

Then when you write a post or add a page, simply wrap the [ mem ] and [ /mem ] shortcode tags around the content you want to hide and when a user views the post/page, they will have a login form where the content should be if they aren’t already logged in.

Many themes nowadays look much better if your posts have a featured image. Using words on their own sometimes just isnt enough – to get your point across images are required. Using the code below, you can force a post to have a featured image set before the post is published.

Step 1. – From your WordPress dashboard open the Appearance menu and select editor, then select your functions.php – add the following code:

add_action(‘save_post’, ‘wpds_check_thumbnail’);
add_action(‘admin_notices’, ‘wpds_thumbnail_error’);

function wpds_check_thumbnail( $post_id ) {
// change to any custom post type
if( get_post_type($post_id) != ‘post’ )
return;

if ( ! has_post_thumbnail( $post_id ) ) {
// set a transient to show the users an admin message
set_transient( “has_post_thumbnail”, “no” );
// unhook this function so it doesn’t loop infinitely
remove_action(‘save_post’, ‘wpds_check_thumbnail’);
// update the post set it to draft
wp_update_post(array(‘ID’ => $post_id, ‘post_status’ => ‘draft’));

add_action(‘save_post’, ‘wpds_check_thumbnail’);
} else {
delete_transient( “has_post_thumbnail” );
}
}

function wpds_thumbnail_error() {
// check if the transient is set, and display the error message
if ( get_transient( “has_post_thumbnail” ) == “no” ) {
echo “<div id=’message’ class=’error’><p><strong>You must add a Featured Image before publishing this. Don’t panic, your post is saved.</strong></p></div>”;
delete_transient( “has_post_thumbnail” );
}
}

That’s all there is to it – now every post/page will require a featured image – you may want to provide a generic “no featured image available” image for people to use when they don’t have an image of their own. But have fun with this hack!