samedi 27 février 2016

Is there some way to insert custom archive loop to any theme from plugin?

I'm coding plugin that create custom post type with custom fields. Now I need to build custom archive/category/tag templates which should contain custom fields.

The problem is that I couldn't insert template part inside archive loop from plugin.

Is there some hook to insert custom loop inside activated theme? Something like this:

add_filter('the_content', 'change_content_in_single_post');

Now I'm using this hook:

add_filter( 'template_include', 'change_all_archive_template' );

... but it have changed all page and if I change theme I need to change code in plugin :(

Do you know how to code plugin (template part) more compatible with wp themes?

Huge thanks for any help!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire