crowdfavorite / wp-post-formats

An admin interface and structured post meta for WordPress post formats.
363 stars 78 forks source link

not loading tabs on pages, when post formats are enabled. #30

Closed Pushplaybang closed 11 years ago

Pushplaybang commented 11 years ago

Hey There

Love this, integrating it into a theme currently, and wanted to add post formats to pages as well, which I've got working. but adding in the post_formats UI, only the css seems to be applied on the add/edit page screen, (seen from the display : none being applied to both the title and the standard post formats div ) but the tabs are not being generated.

Any suggestions would be greatly appreciated.

Paul.

Pushplaybang commented 11 years ago

note : to clarify, Its working perfectly on the posts screen.

FutureMedia commented 11 years ago

Post formats, as the name implies, are for posts not for pages. BTW, you may find useful my Post Formats Panel plugin - https://github.com/site-59/Post-Formats-Panel

Pushplaybang commented 11 years ago

@FutureMedia as the codex may imply - post formats were designed to work with pages as well as all the other "POST" types.

for example not all the post formats may be applicable but heres a brief use case where having this administrative function alllows intricate views to be managed easily.

for a custom post type "event" - a "custom page template" might contain a calendar introduction / featured event slider while a "custom post archive" may just list all the events in chronological order, while further an event gallery could be displayed by selecting the "gallery" post format for that page, displaying yet another view.

to reserve them only for the blog would be silly, and as can be seen in WP the post formats are useable for all post types.

I'd like to get this admin panel working on pages to create a consistent UI for the post formats for my various types (though I'm filtering the post formats so certain types would have limited available formats.)

Pushplaybang commented 11 years ago

anyone else had this issue? or resolved it ?

alexkingorg commented 11 years ago

Looks like it should work to me:

https://github.com/crowdfavorite/wp-post-formats/blob/develop/cf-post-formats.php#L66

If it's not, a patch/pull request to fix it would be very welcome.

Pushplaybang commented 11 years ago

Hey Alex, yeah Its kinda half working in my theme at the moment but will only have time to give it another proper go over the weekend.... I can see the css loads, no erros in the console or any of the obvious stuff, but no dice interms of the tabs appearing, asking if it was at all known as the code looked like it should work to me after I had a quick look over the code.

I'll persevere and report back if I get it down....

Pushplaybang commented 11 years ago

Hey There,

So I've eventually got back to this, and its still a bit of a head scratcher.

I'm able to add the UI to posts, and custom post types, but when using add_post_type_support('page', 'post-formats') to add it to pages it fails.

Currently there are no errors in the console, neither are there any debug errors being thrown up. The CSS and JS files are loading and shown in the dom, but interestingly whats not shown in the dom is the tabs, so something is either failing in JS or prior to the JS thats not throwing an error in our general direction.

@alexkingorg I'm really stumped at this point, happy to keep at it as I'd really like to get this to work, but any thoughts around this issue would be great.

alexkingorg commented 11 years ago

Most effective debugging is done by digging in and seeing what the code is really doing.

Pushplaybang commented 11 years ago

lol, thanks I think, I'm swimming in it, dunno if I'm missing something obvious in the code but no luck yet, it all looks as though it should be working....

Pushplaybang commented 11 years ago

got it.

add_action('edit_page_form', 'cfpf_post_admin_setup'); on line 81 as the edit_form_advanced doesn't seem to fire on the page edit screen. (it should be added, not replacing the other add_action above it.)