Echo text if field under user_meta is empty with get_users()

When you have that much code to output concatenating it into one string like that makes it very difficult to read for others and yourself, also, to debug when things go wrong. Try this method for concatenating your output, $blogusers = get_users(‘role=contributor&orderby=display_name’); foreach ($blogusers as $user) { $name = $user->display_name; $url = get_author_posts_url($user->ID, $author_nicename); $class … Read more

Get custom field from page, in a post?

I would suggest a different approach. The option for manually adding post excerpt should go in a theme option as opposed to a custom field. Also you should use this hook for modifying the excerpt’s more text http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_more If the user is supposed to enter custom excerpt on a per-post basis, they can do it … Read more

list pages by custom_field?

Not sure if this help. If you use normal wordpress loop to query post or pages then you can do this by using query_posts You need to place a line of query_posts before the loop start and it might look something like this ( you might need to add some more parameter for getting only … Read more

Should I use a Meta field or custom table?

I can’t really speak to the performance simply because I’ve not dug in to the internals. But from a pure logic approach the custom meta makes more sense to me. The reason being that, at least from your description, you only really need a single field for each post/page. All you’re doing is reading a … Read more

Custom search with meta fields

I think that your main problem is that you are trying to display the results with searchform.php. That is basically just the form for the search, which you don’t need since you have your own form in the sidebar (if I understand you correctly). The results of a WP search are displayed with “search.php“

Display posts where date field matches current month?

You can use the meta_query parameter to display all events for the current month like this: $start_date = date( ‘ym01’ ); $end_date = date( ‘ymt’ ); $meta_query = array( ‘key’ => ‘event_date’, ‘value’ => array( $start_date, $end_date ), ‘compare’ => ‘BETWEEN’, ‘type’ => ‘NUMERIC’ ); $args = array( ‘post_type’ => ‘hh_event’, ‘posts_per_page’ => -1, ‘orderby’ … Read more

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