Trimming a custom field to a length

The excerpt is a specific field in WordPress and is wholly unrelated to custom fields, which is why the excerpt stuff you tried has no effect. There is no built in way to trim custom fields, you have to do it manually with a bit of php: $length = 20; $text=”Lorem ipsum dolor sit amet, … Read more

About WordPress capabilities [closed]

…use WP as a engine where user can contribute their post and others can review it. I don’t think you need a plugin for what you want to do. Enable user registration on your WordPress site by going to WordPress Dashboard > Settings > General and checking Anyone can register option. Then right below it … Read more

Insert Message before content of after title

You need to use ‘the_content‘ filter function add_before_content($content) { return ‘Before content area ‘.$content; } add_filter(‘the_content’, add_before_content); It will still be inside the content div. If you want it outside the div you have to edit related template files i.e. single.php or templates/content-single.php. It all depends on which pages you want to apply it.

Best Way to Add UnEditable HTML to Posts

Is there a way to make it so that the user cannot delete certain things inside posts content? You need… A shortcode that will generate the content. This will let your users provide input but the markup can be rigidly controlled. Or a custom meta field. The markup around this can also be rigidly controlled, … Read more

Remove empty rows from the database

I’d imagine those rows with empty content are more often then not revisions rather than trashed posts. To make sure you don’t delete stuff you want to keep I suggest you add the post_status to your SQL, using trash and auto-draft as value – the latter are the revisions. Btw the table column is called … Read more