Custom field for image, not showing image!

It looks like you’re using a custom plugin. Is that the case? Anyway for the line: <?php echo get_post_meta($post->ID, ‘banner_image’, true); ?> Why aren’t you using something like: <img src=”https://wordpress.stackexchange.com/questions/21729/<?php bloginfo(“template_url’); ?>/images/<?php echo get_post_meta($post->ID, ‘banner_image’, true); ?>”/> Another way to debug is to echo the post ID to the screen and see if it is … Read more

How to mark a image attachment as background image?

You could use the plugin “Custom Field Template” to replace standard custom fields with a much easier to use interface, that also allows you to use checkboxes, selects, textareas with tinymce, and file uploads among others. Then the client would just upload the image through that field and you use <?php $bg = wp_get_attachment_image_src(get_post_meta($post->ID, ‘custom_field_name’, … Read more

Show div based on custom meta value

Then you need a filter on the_content. function add_conditional_div($content) { global $post; $meta_field = get_post_meta($post->ID, ‘your-field-name’, true); if (1 === $meta_field) { $content .= ‘<div>whatever</div>’; } return $content; } The 1 value, of course, is whatever should match your meta_field. http://codex.wordpress.org/Function_Reference/get_post_meta http://codex.wordpress.org/Function_Reference/the_content You could also edit your theme files directly or make a child theme. … Read more

Add values of post meta fields?

You can put the meta value of each post within an array while inside loop. Then just calculate the average of the ratings after the loop ends. for getting meta values you can see this link Function Reference/get post meta

Extract array from custom field

This is mostly pure PHP, but you need to implode the array. add_shortcode(‘bundled_ids’,’bundled_ids_func’); function bundled_ids_func() { $meta_values = get_post_meta( get_the_ID() , ‘_bundled_ids’, true ); if (!empty($meta_values)) { $mydata = implode(‘,’,$meta_values); // add this line return $mydata; } }

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