Update custom category fields front-end

the function wp_insert_term returns the newly created term id (or WP_Error on error), so once your create your term you need to store it’s ID and then you can save the “extra fields” using get_option, update_option something like: if($_SERVER[‘REQUEST_METHOD’] == “POST”) { $clientName = $_POST[“clientName”]; $term_id = $_POST[“clientName”]; $clientKeywords = $_POST[“clientKeywords”]; $clientSlug = $_POST[“clientSlug”]; $parent=””; … Read more

Problem uploading different files as custom fields with front end post form

For starters, the ‘post_category’ argument only accepts category ID’s, so you will have to find that through your database, or through get_category_by_slug: $cat = get_category_by_slug( ‘music’ ); $cat_id = $cat->term_id; Secondly, look at your wp_handle_upload() section. You are passing $file[‘file’] in both cases, where ‘file’ is not the name of either of your upload fields. … Read more

display custom portfolio tags

You will need to know the name for your “portfolio_tags” taxonomy. Check where it is defined as a custom taxonomy, and it will need to be added to the portfolio custom post type. The register_taxonomy() function would be your theme like this: register_taxonomy(‘portfolio_tags’, array(‘portfolio’), array(‘hierarchical’ => false, ‘show_ui’ => true, ‘query_var’ => true, ‘rewrite’ => … Read more

Adding extra fields to front end signup form

You can read a somewhat extensive tutorial over at: http://www.cozmoslabs.com/1012-wordpress-user-registration-template-and-custom-user-profile-fields/ Basically this is what you’re going to be using to add them to the backend: add_action( ‘show_user_profile’, ‘show_extra_profile_fields’, 10 ); add_action( ‘edit_user_profile’, ‘show_extra_profile_fields’, 10 ); function show_extra_profile_fields( $user ) { ?> <input type=”text” name=”twitter” value=”<?php echo esc_attr( get_the_author_meta( ‘twitter’, $user->ID ) ); ?>” /> <?php … Read more

Categories from front-end, checkbox selection doesn’t work

You changed the checkbox’s name attribute value. You should use the same name value: terms[$taxonomy][] This should fix the code: if (is_taxonomy_hierarchical($taxonomy)) //$out .= “<input class=”{$term->term_taxonomy_id}” type=”checkbox” value=”{$term->term_taxonomy_id}” name=”{$term->term_taxonomy_id}” /> {$term->name}<br />”; $out .= “<input class=”{$term->term_taxonomy_id}” type=”checkbox” value=”{$term->term_taxonomy_id}” name=”terms[{$taxonomy}][]” /> {$term->name}<br />”; else // $out .= “<input class=”{$term->term_taxonomy_id}” type=”checkbox” value=”{$term->name}” name=”{$term->name}” /> {$term->name}”; $out .= … Read more

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