Front end form to create a custom post with preview

There are many ways you could use to reach your goal. Here’s one… Steps: Create a shortcode that renders the form. Create and enqueue a JavaScript file that handles the form submission. Create PHP function for creating/updating Post/Custom Post. In your functions.php: /** * @return string $html HTML form. */ function shortcode__new_post_form() { /** * … Read more

Display List Of Posts Containing a Relationship Field Value [ACF]

I am updating my complete answer based on your clarification in the comment below. I hope this helps: <div class=”entry-content”> <h2>Documents written by this writer</h2> <?php /* * Query posts for a relationship value. * This method uses the meta_query LIKE to match the string “123” to the database value a:1:{i:0;s:3:”123″;} (serialized array) */ $documents … Read more

Order get_terms using a Custom Field

Rather than outputting your terms in that initial loop, I would use it instead to build a new array, with your issue_date as the key: $my_new_array = array( ); foreach ( $terms as $term ) { $issue_date = get_field( ‘issue_date’, $term ); $my_new_array[$issue_date] = $term->name; } You can then loop through this new array in … Read more

ACF – get fields from group

Thank you so much for your post, I spent half day to figure out how to get field names by their group. If you have field names, you can easily get their values: get_field($field[‘name’]); EXAMPLE HOW TO GET IMAGES FOR SLIDER <?php //or insert the ID of your fields Group. $groupID=’116′; $custom_field_keys = get_post_custom_keys($groupID); foreach … Read more

Filter next_post_link() and previous_post_link() by meta_key?

I managed to get this working using nothing but WordPress filters, thanks to @Milo’s hint. Just note that these are pretty specific to my case but you shouldn’t have a problem modifying them for your own use. I am using Advanced Custom Fields with a Date Picker field called date and Prev/Next links only point … Read more

How to import CSV into Custom Post Type custom fields?

I’m using a plugin called TurboCSV (found here, at the time of writing). The plugin offers support to add data to your various custom fields, which need to be created before the import takes place. In my personal use, I was able to successfully import thousands of items from one .csv, including hundreds of taxonomy … Read more