Copying custom field value in to title

Try this: add_action(‘init’, ‘replace_title_logic’); function replace_title_logic() { add_filter(‘wp_insert_post_data’, ‘replace_title_before_update’, 20, 2); add_action(‘wp_insert_post’, ‘replace_title_after_save’, 20, 2); add_filter(‘wp_insert_post_empty_content’, ‘allow_empty_content_for_listing’, 20 , 2); } function replace_title_before_update( $data, $postarr ) { if ( is_int($postarr[‘ID’]) && ($data[‘post_type’] == ‘listing’) ) { $custom = get_post_meta($postarr[‘ID’], ‘ref._nr.’, true ); if ( $custom && ( $custom != $data[‘post_title’] ) ) $data[‘post_title’] = $custom; … Read more

2nd and 3rd Custom Post Type URL’s 404ing

It turns out that global $wp_rewrite; is sitewide as far as I understand but am willing to be informed of the details here. Implementing it with a CPT RUINED my rewrite rules sitewide. Changing the rewrite=> array(‘slug’=>’name’) should have been where I stayed and back to basics on how to manipulate a CPT’s permalink structure.

Categories in custom post types

If you want to use builtin WordPress categories, while calling register_post_type function with taxonomies parameter set to category If you want to create a custom category, then use register_taxonomy function to register a brand new taxonomy with second parameter to be your custom post type name and pass it taxonomy name to register_post_type as explained … Read more

How to remove website field in comment form?

Your theme should have a comments.php file. Can you just remove the field there? For instance, my comments.php files has the following code: <p class=”field”><label for=”url”><?php _e(‘Website’, ‘theme1721′); ?> </label><input type=”text” name=”url” id=”url” value=”<?php echo esc_attr($comment_author_url); ?>” size=”22″ tabindex=”3″ /></p> I would just remove it if I didn’t want visitors to have the option to … Read more