Fields for different parts of a page
Fields for different parts of a page
Fields for different parts of a page
The excellent My Metabox class by bainternet does exactly what you are looking for. Add a post dropdown list with $my_meta->addPosts(‘posts_field_id’,array(‘post_type’ => ‘post’),array(‘name’=> ‘My Posts ‘)); And it will create a meta box with posts dropdown (you can change this to a checkbox list if you want to be able to select more than one … Read more
How to get a custom field value of a custom post?
How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
Use switch_to_blog( $new_blog_id ), use get_post_meta($post_id, $key ) to get the value of the field, and run restore_current_blog() when you are done. You could use a site option (add_site_option($option, $value)) and store the values you need in an array there in addition to the post meta field. This would save the rather expensive switch_to_blog() calls.
Hierarchical custom fields
You only need one form and a callback on pre_get_posts. For example: <form role=”search” method=”get” id=”searchform” action=”<?php echo $current_url; ?>”> <input type=”hidden” name=”s” value=”true” /> <!– Tag Search –> <label for=”tags”>Search Tag:</label> <input type=”text” value=”Search” name=”tags” id=”tagsearchbox” /> <!– Custom Field “autor” Search –> <label for=”autors”>Search in Custom Field ‘autor’:</label> <input type=”text” value=”Search” name=”autors” id=”autorsearchbox” … Read more
I just wrote a plugin that does just that. It’s been submitted to the WordPress.org plugin repo earlier this week and hopefully should make an appearance soon. The plugin is officially in the WordPress.org repo. In short what you are looking for is a way to have the following code available on your post editor: … Read more
http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields you can also get all the detail manually from here
Possible to filter custom post type with multiple meta data?