Define a Minimum Word Per Post


Sponsored Links




WordPress built with many hooks and action that we can put it and make it easy to hack original WordPress code without broken overall functions. On this sample we will show you how to define a minimum word count per post on your WordPress.

Define a Minimum Word -The Vampire Diaries

Define a Minimum Word -The Vampire Diaries


This function is useful, if you want to be able to keep a minimum word count for your posts. To use this code put this code on functions.php

function minWord($content){
    global $post;
        $num = 100; //set this to the minimum number of words
    $content = $post->post_content;
    if (str_word_count($content) <  $num)
        wp_die( __('Error: your post is below the minimum word count.') );
}
add_action('publish_post', 'minWord');

Thanks for WP Recipes for share this tips, this code original written by Pippin WIlliamson

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

How to define a minimum word count per post

Daily recipes to cook with WordPress If you want to be able to keep a minimum word count for your posts, then just read this recipe. Read More

Carpe diem - Wikipedia, the free encyclopedia

In Bread, the phrase is part of the longer Carpe diem quam minimum credula postero – "Seize the Day, putting as little trust as possible in the future", and the ode Read More

Salary - Wikipedia, the free encyclopedia

The minimum wages in India are governed by the Minimum Wages Act, 1948 Outside Sales Employee is the only main category not to have the minimum salary ($455 per Read More

The | Define The at Dictionary.com

another word for per, esp with nouns or noun phrases of cost: fifty pence the pound: 12. facetious, derogatory often, or my; our: the wife goes out on Thursdays Read More

How to Define Retail Margin | eHow.com

How to Define Retail Margin. Retail margin is not too hard a concept to grasp. is a simple way to calculate contribution margin for accounting in total or per unit. Read More


Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>