Including custom fields in search?
You could use a plugin like “Search Everything” which lets you toggle what to include in the search (including Custom Fields). Check it out here: http://wordpress.org/extend/plugins/search-everything/
You could use a plugin like “Search Everything” which lets you toggle what to include in the search (including Custom Fields). Check it out here: http://wordpress.org/extend/plugins/search-everything/
I’ve found that for things like this, get_posts is easier. <?php // Set up your arguments array to include your post type, // order, posts per page, etc. $args = array( ‘post_type’ => ‘testimonial’, ‘posts_per_page’ => 3, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’ ); // Get the posts $testimonials = get_posts($args); // Loop through all … Read more
I found last part of @birgire answer the most useful way, however it breaks the possibility to tab to content. In fact I think is normal focus the content by click tab while in the subtitle field. To do that, you have also to take care if the content is shown in the “Text” tab … Read more
You should (if available) submit the code you are working with, even if just a snippet, so we can assess your process in relation to your question. The short answer however is YES, it is safe, so long as you, prevent input fields being displayed on user profile page for certain user roles prevent unauthorized … Read more
Add the following code in the functions.php for acf function get_all_meta($type){ global $wpdb; $result = $wpdb->get_results($wpdb->prepare( “SELECT post_id,meta_key,meta_value FROM wp_posts,wp_postmeta WHERE post_type = %s AND wp_posts.ID = wp_postmeta.post_id”, $type ), ARRAY_A); return $result; } function acf(){ $options = array(); $acf = get_all_meta(‘acf’); foreach($acf as $key => $value){ $options[‘post_type’][$value[‘post_id’]][‘post_id’] = $value[‘post_id’]; $test = substr($value[‘meta_key’], 0, 6); … Read more
Take a look at update_user_meta you can save user data if they are registering or signed in, its just a matter of what user ID you pass to it. say in your function to save the user data after he is logged in: function save_user_data_7231(){ global $current_user; if is_user_logged_in{ //check if user is logged in. … Read more
SOLUTION – Updated: 03/03/2015 – Thanks to /u/G.M. The below adds a new field to the Term Edit Page and saves the value into the un-used ( for the moment anyway ) term_group field which can then be used to order terms. In the below hooks ( actions ) you’ll need to replace TAXONOMY_SLUG with … Read more
Even though you’ve disabled title for your custom post type, if you use the post name post_title for your own title input, WordPress will still use it and update the post title accordingly.
It seems that the action save_post gets fired when sending a post to the trash… Therefore, my custom metadata save function was being activated with no $_POST data to send thru it. To circumvent this, I wound up adding a nonce to the save function. function wpg_testimonial_author() { global $post; $custom = get_post_custom($post->ID); $testimonial_author_name = … Read more
Using the Advanced Custom Fields plugin you can assign options pages to you custom posttype like this: if( function_exists(‘acf_add_options_page’) ) { acf_add_options_page(array( ‘page_title’ => ‘YOUR_PAGE_TILE Options’, ‘menu_title’ => ‘YOUR_MENU_TITLE Options’, ‘menu_slug’ => ‘options_YOUR_SLUG’, ‘capability’ => ‘edit_posts’, ‘parent_slug’ => ‘edit.php?post_type=YOUR_CUSTOM_POSTTYPE_SLUG’, ‘position’ => false, ‘icon_url’ => ‘dashicons-images-alt2’, ‘redirect’ => false, )); } That way you get an … Read more