Returning website screenshot based on Custom Field

i think there is an error – <img src=”https://wordpress.stackexchange.com/questions/105525/<?php echo”http://s.wordpress.com/mshots/v1/’.urlencode(the_field(‘website’); ‘).’?w=200′ ?>” /> it should be <img src=”https://wordpress.stackexchange.com/questions/105525/<?php echo”http://s.wordpress.com/mshots/v1/’.urlencode(the_field(‘website’).’?w=200′ ?>” alt=”” /> And if this not work. I think you use the_field(‘website’) function which actually not return result you can try this code. <img src=”https://wordpress.stackexchange.com/questions/105525/<?php echo”http://s.wordpress.com/mshots/v1/’.urlencode(get_the_field(‘website’).’?w=200′ ?>” alt=”” />

Order by custom field in query multiple

You need ‘order_by’ => ‘post__in’ in the last query in order to “Preserve post ID order given in the post__in array (available with Version 3.5).”. I don’t know if the order you are passing in is the order you want after the array_merge( $group_1, $group_2). In other words, you need to feed that second query … Read more

Load code for custom fields only on admin pages?

Loading this code won’t have big impact on loading times. Of course you should make sure, that this code is only executed when it should be… But yes, it should be possible. Just make sure you don’t use it to early (when is_admin() return incorrect value). EDIT The code you’ve posted here should work just … Read more

Custom Field add markup to line breaks

I believe this is what you are after: // define $post_id, $key, $single $multipleLineValue = get_post_meta($post_id, $key, $single); // Convert into an array where desired code can be added to the output $multipleLineValue = explode(“\n”,$multipleLineValue); $output = “”; foreach ($multipleLineValue as $lineValue) { $output .= “<span>”.$lineValue.”</span><br>”; } echo $output;

Show message if statement is false – foreach

OK, it’s a lot of guessing, because I can’t see the rest of your code, but something like this should work, I hope… <?php $value = get_post_custom_values(“kpm_UploadFile”); $url = ($value[0]); $tokens = explode(“https://wordpress.stackexchange.com/”, $url); $dlvalue = $tokens[sizeof($tokens)-1]; if (current_user_can(‘read’)) { $found = 0; foreach ($files_array as $key => $val) { if ($dlvalue == $val) { … Read more

Meta_query not filtering posts

I think you don’t have to use meta_query. Simply use the code like shown below: $args = array( ‘post_type’ => ‘property’, ‘meta_key’ => ‘rental_type’, ‘meta_value’ => ‘Vacation’ ‘posts_per_page’ => $properties_per_page, ‘paged’ => $paged ); Also you got to get the value of $properties_per_page before this query.

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