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

uploading photos

This might came from your access right: First, check that you are a writer or an admin (See User in Admin Panel) > general > Role Second, if this is not the problem check the rights of yoursource files into your server ( you can easily check this on your FTP files or if you … Read more

(WordPress) How to get custom taxonomy parent name?

Using two nested foreach you prevent n+1 db queries, where n is the number of child terms: <?php $_cats = array(); $args = array( ‘orderby’ => ‘id’, ‘order’ => ‘ASC’, ‘taxonomy’ => ‘album’ ); $categories = get_categories($args); if ( ! empty($categories) ) { foreach( $categories as $category ) { if ( $category->parent != 0 ) … Read more

Metabox textarea showing whitescreen

I bet it’s much simpler than it seems… Replace <textarea name=”ourwork[%1$s][client-desc]” value=””></textarea> with: <textarea name=”ourwork[%1$s][client-desc]”>%7$s</textarea> Don’t forget to replace string in jQuery code, too. 2 Problems: You forgot %7$s Textarea don’t use value=”” but put value between <textarea> and </textarea> (if you use value=”” it will be saved but not showed)

How to export database correctly for local to online

What Options are you changing after upload to production server? I think after upload .sql file your website don’t want appear in browser? Check it: After import your local .sql file to production server, log in to production/phpmyadmin website, go to wp_options and check values: | option_id | option_name | option_value | —————————————— | id=1 … Read more