0

I am working on my new WP Plugin for advanced control of custom post types and meta boxes.

Actually, I am working on an HTML Builder for the full customization of single and archive templates for the registered CPT.

I am struggling now with this problem: how to integrate these new templates into any Wordpress theme?

I found this:

Dynamically override page.php or single.php with custom templates using function

It fits my needs indeed but since every Wordpress theme is different I don't know how to integrate my custom content into the theme structure with its elements like any other template page (headers, footer, sidebar, etc...). Is there a way to use for example single.php base structure overriding only the inner content?

I was looking at other plugins like Pods or Toolset but I can't figure out how to achieve the same result.

I was thinking also to create a dedicated theme to integrate my custom templates, but it doesn't really make me happy.

Anyone can help me?

Thanks in advance

1

Is there a way to use for example single.php base structure overriding only the inner content?

The main content of pages and posts is output using the the_content() function. This can be filtered and changed by plugins using the the_content filter. However this only outputs the content entered into body of the editor. It does not include the title, sidebars, metaboxes, widgets, comments or any other content. This is the closest you will get. The output and structure of everything else is entirely up to the theme, and there's no standardisation.

So for anything more than filtering the content there is simply not enough mandated consistency between WordPress themes for something like this to be feasible.

1
  • Thanks for your reply, I am looking forward to exploring more the_content function, it seems to be the best option I have right now.
    – Mauro
    Aug 19 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.