Is there a way to assign ACF to a post template?
I’ve found the following but I’m not sure if it has been implemented and it is beyond my php skills https://github.com/elliotcondon/acf/pull/3
I am using the the “Single Post Template plugin” found here http://wordpress.org/plugins/single-post-template/
This would be a great addition if this sort of thing is not already implemented
I’m not 100% sure this will make it into the core due to the ‘post template’ being a plugin, not a core function of WP.
That said, someone has already written the extra location rule code for you!
Many thanks, I now have this working.
Just a quick question:
What is the likely hood of this functionality breaking on a future update of ACF or WordPress if the developer doesn’t update his ‘post template’ plugin?
I really don’t want my clients site breaking on future updates. So I’m just wondering how safe it is to implement this sort of thing?
I’m using the latest version of acf
the latest version of the plugin single post template Version 1.4.4
and WP 3.8.1 and the plugin for the plugin 🙂
my theme has a single-xyz.php with a name “Single Post Template: Banken”
Single Post Template is working fine…
At ACF I see the dropdown for Post Template but I can’t choose a template because this dropdown is empty.
Any help .. ?
Great to find this post.
I am trying to get single post template to work with ACF, but it is not.
I have created templates and have it working properly when creating normal posts, the “single post template” drop down menu appears under the editor.
But I cannot see the SPT drop down under the ACF add new field sections.
Any idea what could be wrong? I am running WP 4.1 and the latest versiion of SPT, and I have already followed the above instructions and changed “Template Name Posts” to “Single Post Template” but still the drop down is not showing anywhere in ACF
Any help would be great.
Thanks in advance (hope I don’t have to wait a year (lol)
I’m trying to use the plugin along with Single Post Template, I made some few steps, but I’ve got a js error.
This is what I’ve done:
1) I changed all “Template Name Posts” to “Single Post Template” (there are a few)
2) I changed the jquery selector to match the Single Post Template dropdown id: #post_template (instead of #custom_post_template as in CPT plugin)
I have post templates in dropdown,
but when I switch template, I have this js error:
TypeError: acf.screen is undefined
PS: I’m using ACF PRO 3.7.4
Thanks to Eliot supporto i solved.
Correct way to reference to acf js is
acf.ajax.update( 'cpt', jQuery(this).val() ).fetch();
I made a github fork of the lukechapman plugin, tu be used for Single Post Template plugin instead of Custom Post Template plugin
Hi, I”m having a similar issue / need with a radio button.
Once set “on” I want a relationship field populated.
I’ve been hammering on the
acf.ajax.update but not sure what your
'cpt' is, is it the field name? field ID?
And does this update your field automatically? I tried with both my relationship field, and a test input (text) field.. could not figure out how to set value.
The topic ‘Assign ACF to a post template?’ is closed to new replies.
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!
© 2022 Advanced Custom Fields.