Display custom post type and custom fields within a Bootstrap Carousel

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

Saving custom data for each user

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

Add custom field to the archive page?

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