custom-post-template-support-for-acf
custom-post-template-support-for-acf copied to clipboard
SIngle Post Template plugin update
Hey Luke,
THANK YOU for this. It's super helpful. Just wanted to note that SPT has updated their code and all instances of "Template Name Posts" need to be changed to "Single Post Template"
Thanks!!
Thanks for the heads up! I need to review this again with the updates of ACF to 5.0/Pro, so will definitely be sure to include this
You got it!
Also, I realized that even though I was able to get the drop down list to appear with my change, ACF is ignoring the set value and the custom field shows up everywhere. Perhaps I needed to do more to fix the issue?
Turns out I was using "Single Post Template" plugin instead of "Custom Post Template"
So perhaps that is where the problem is..
Oh! Perhaps I can make it work for both plugins
That would be genius! Thanks.
Sorry for being a pain about this, but it's crazy useful!
ms. oka tai-lee 412.608.7669
On Fri, Mar 6, 2015 at 3:40 PM, Luke Chapman [email protected] wrote:
Oh! Perhaps I can make it work for both plugins
— Reply to this email directly or view it on GitHub https://github.com/lukechapman/custom-post-template-support-for-acf/issues/3#issuecomment-77631615 .
Hi folks, I'm trying to adapt this plugin to use with "Single Post Template" plugin instead of "Custom post Template" as @okadots does, but it's not working.
- I can show the templates in ACF conditional dropdown changing the references from "Template Name Posts" to "Single Post Template"
- I can reference to the template dropdown changing the jQuery select form #custom_post_template to #post_template (and I can read the value on change)
but I got this js error when changing the template:
TypeError: acf.screen is undefined
PS: I'm using ACF Pro, maybe this is causing the issue?
any idea?
Issue solved. The right way to reference acf is the following:
acf.ajax.update( 'cpt', jQuery(this).val() ).fetch();
If someone is interested, I made a Fork for the Single post Template plugin: https://github.com/bluantinoo/single-post-template-support-for-acf