custom-post-template-support-for-acf icon indicating copy to clipboard operation
custom-post-template-support-for-acf copied to clipboard

SIngle Post Template plugin update

Open okadots opened this issue 10 years ago • 7 comments

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!!

okadots avatar Feb 22 '15 23:02 okadots

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

lukechapman avatar Feb 27 '15 20:02 lukechapman

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?

okadots avatar Feb 27 '15 20:02 okadots

Turns out I was using "Single Post Template" plugin instead of "Custom Post Template"

So perhaps that is where the problem is..

okadots avatar Mar 06 '15 20:03 okadots

Oh! Perhaps I can make it work for both plugins

lukechapman avatar Mar 06 '15 20:03 lukechapman

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 .

okadots avatar Mar 06 '15 20:03 okadots

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?

bluantinoo avatar Feb 19 '16 11:02 bluantinoo

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

bluantinoo avatar Feb 24 '16 11:02 bluantinoo