Home › Forums › ACF PRO › Testimonials › Reply To: Testimonials
Yes I have created testimonial systems using ACF. I am board this morning so I will help you along.
Create Testimonial Post Type in your functions.php
$labels = array(
"name" => __( 'Testimonials', 'themeSlug' ),
"singular_name" => __( 'Testimonial', 'themeSlug' ),
"menu_name" => __( 'Testimonials', 'themeSlug' ),
"all_items" => __( 'All Testimonials', 'themeSlug' ),
"add_new" => __( 'Add New', 'themeSlug' ),
"add_new_item" => __( 'Add New Testimonial', 'themeSlug' ),
"edit_item" => __( 'Edit Testimonial', 'themeSlug' ),
"new_item" => __( 'New Item', 'themeSlug' ),
"view_item" => __( 'View Testimonial', 'themeSlug' ),
"search_items" => __( 'Search Testimonials', 'themeSlug' ),
"not_found" => __( 'No Testimonials Found', 'themeSlug' ),
"not_found_in_trash" => __( 'No Testimonials in trash', 'themeSlug' ),
"parent_item_colon" => __( 'Parent Testimonial', 'themeSlug' ),
"archives" => __( 'Testimonial Archives', 'themeSlug' ),
"insert_into_item" => __( 'Insert into Testimonial', 'themeSlug' ),
"uploaded_to_this_item" => __( 'Uploaded to this Testimonial', 'themeSlug' ),
"filter_items_list" => __( 'Filter Testimonial List', 'themeSlug' ),
"items_list_navigation" => __( 'Testimonial list navigation', 'themeSlug' ),
"items_list" => __( 'Testimonials List', 'themeSlug' ),
"parent_item_colon" => __( 'Parent Testimonial', 'themeSlug' )
);
$args = array(
"label" =>'Testimonials',
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"has_archive" => true,
"show_in_menu" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => array( "slug" => "testimonials", "with_front" => true ),
"query_var" => true,
"supports" => array( "title","editor" ),
"menu_icon" => "dashicons-format-status",
);
register_post_type( "testimonials", $args );
Create Front End Form in a page template file. This one will save the post as pending so you can login and approve.
See https://www.advancedcustomfields.com/resources/acf_form/ for more form settings
acf_form(array(
'post_id' => 'new_post',
'field_groups' => array(6), // Used ID of the field groups here.
'form' => true,
'new_post' => array(
'post_type' => 'testimonials',
'post_status' => 'pending'
),
'submit_value' => 'Submit Book',
));
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
π Weβre excited to announce we've released Composer support for installing ACF PRO.
— Advanced Custom Fields (@wp_acf) January 31, 2023
π #ComposerPHP fans rejoice!
β¨ Please see the release post for all the details and full instructions. https://t.co/ebEfp61nlR
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.