Post rating using Custom Field

First off, you should consider using using the building WordPress functionality rather than linking straight to a PHP file. Anyone could game that very easily and artificially vote up posts. To use the wordpress ajax functionality, send your ajax request to yoursite.com/wp-admin/admin-ajax.php, and use standard plugin hooks system. Tollmanz’s response is right on: your update … Read more

Including inline Custom Fields info with add_filter in functions.php

You are trying to echo within a variable. You also have encapsulated PHP tags in the string as well. You need to concatenate just the functions themselves like this: function default_content($content) { global $post; if ($post->post_type == ‘my-custom-post-type’) { $content .= ‘<p style=”text-align: center;”><strong>Custom Field Text here: ‘. get_post_meta( $post->ID, “custom-field-1”, true ).'</strong></p> <p style=”text-align: … Read more

sort a custom field base on the date or anything

Multiline is not an array (rant) You need to use standard dates for this to work DD/MM/YYYY (first row) Use the PHP function usort() to sort the fields Use strtotime() to convert that date to a timestamp and date_i18n() to output it If you need an actual example, change the date formats to what I’ve … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)