Tag Info

New answers tagged

1

The child_of parameter excepts an integer value of the specific term you need to get descendants from. This means that you need to get the ID from the On-going category term and then passing that ID to the child_of parameter. To note, the child_of parameter returns all descendants of the term passed, this includes direct children and all children of those ...


1

as ChrisL said in the comments, you should add order and orderby to your arguments : $args = array( 'post_type' => 'totem', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC' );


1

Your data is being serialize properly. Your code saves an array of integers. Integers are not strings and so a string length is not saved. Run the following code and it should illustrate the point: $str = 'a:4:{i:0;s:4:"7613";i:1;s:4:"7615";i:2;s:4:"7616";i:3;s:4:"7618";}'; $str = maybe_unserialize($str); var_dump($str); echo '<br/>'; ...


3

When you are saving the multidimensional array you can use this code: $product_img_path[$count]['wpc_resize_thumb_img'] = $upload_dir['url'].'/'.$resize_img_name; $product_img_path[$count]['wpc_resize_bid_img'] = $upload_dir['url'].'/'.$resize_big_img_name; update_post_meta($post->ID, 'wpc_images', $product_img_path); That way you can get ...


0

Ah, I see a few places where I went wrong. For one, in the switch statements, when I tried to return answers using echo, I was using parentheses, which work fine in one offs, but apparently cause an error in a function(?). Thanks to the one who edited my first code! I would not have seen that. So when I changed this: switch($graphic[0]) { case 1: ...


0

There is no "fields" argument to add_meta_box(), which I assume is what you are using and not some code-bloat-ie helper function/class nonsense. And you've not identified a callback, which is the key. Create a callback and put your "warning" array in that, along with code to create your checkboxe/radio-boxes, or whatever you need. $wpar_meta_box = array( ...


0

No, you can't do that via a query. You can request everything then manually filter out items via PHP, but that would be slow. Instead, you need to address the root problem, that you're storing serialised PHP data in a single field, rather than multiple fields, e.g. you should have an option1 meta key/value and an option2 meta key value pair etc As a ...



Top 50 recent answers are included