Site logo

Archived topic

Import external HTML markup into header elements

8 replies · Started by George on February 3, 2020

Viewing posts 1–9 of 9

I have been recently optimizing and organizing my development process by following SCSS functionality and CSS BEM methodology and there is a project where I need to customize a large number of header elements that have slightly different HTML markup. I was wondering if there is a way to actually import HTML in a header element from an external file. Ideally, all markup would be contained in one HTML or PHP file so that I can develop faster and see all code at once but importing from separate files is also fine.

Hi there,

when you say import - is this on the front end ? So an external request would be made for this HTML ?

Yes, that's right. Or it could be the import happens on the backend. I just want to be able to code in VS Code without having to keep copy-pasting code to the WordPress admin in the header elements.

Also, as far as I can see only HTML code can be entered in a header element, is that right?

Hmm, I'm not sure if this is possible. If it helps you to research a bit more, the Element content is just a simple custom field, so if there's a solution available that can do this with custom fields, it should work with Elements.

I'll assign this back to David just in case he has any ideas.

Ok, thank you both. It seems more trouble than it's worth, I will do some research myself though.

Thanks again!

I'll keep an eye out for a solution. Let us know if you find one :)

I need the same functionality - any idea or solution found?
Thank you, Walter

No solution found on my end, unfortunately. I think this would likely require something to be custom-built, unfortunately.

Thank you,
Walter

This archived topic is closed to new replies.