2

I am new to the whole WP theme development, but I have undertaken a couple of courses and watched a few tutorials on how to convert HTML/PHP pages into a wordpress theme. However, every single tutorial and course I have found only covered converting a really basic and simple pages the main content of whose contained one <p> element and that was it. I get that - it's pretty straightforward in fact. However, I am now trying to convert my first real webpage which is quite complex and I am really struggling with it.

I have at least 6 different pages which don't have much in common (except header and footer perhaps), therefore I created 6 different "page-slug.php" templates. In each one of them, I have obviously put the loop which will fetch the title, content, etc. And this is where it gets complicated. The content of my original HTML pages obviously contains lots of different elements, such as div, article, section, a, span, p, ul, h1, combinations of these, etc. All these are wrapped by main tag. So in order to convert that page into a WordPress post, I just copied the whole main content (with all the html tags) into the WordPress Post Editor so that the customer is able to edit it themselves. But this basically means that the customer will have to deal with the HTML tags which is not ideal.

I don't want all these to be sidebars either - this is just main content. What is the best practice when having lots of HTML tags? Meta fields, shortcodes or something else?

Any help from someone experienced will be much appreciated :)

1 Answer 1

0

So this question is a little broad, but I will try to give you some options based on my experience working as a web developer with Wordpress for the past years.

If you are developing a theme from scratch based on a Layout where the content is already defined and it's unlikely to change you can do it with Meta Fields, where you define the meta field for a page, do all the markup in the page template and just output the content in it, removing the need of the client add the HTML tags himself. A nice plugin to create meta field is the ACF. It helps a lot.

The good side: The good side of this approach, is that you creating everything on your own thus have more control over the functionality, you're only using the things that you need and you can customize everything as you want.

The bad side: You will be developing everything from scratch and can be much slower compared to another options, depending on the size of the site.

If you need a more flexible layout you can only style the elements of a Page builder and customize some elements or/and add some of your own. With this yours clients will have much more flexibility to change the structure of the site themselves.

A feel page builders:

The good side: Your clients will have much flexibility all over the structure and content of the site without the need to have any coding knowledge.

The bad side: You have to study a third party plugin, usually the page builders (at least the ones I worked with) renders lots of code that can affect the site performance.


I tried to make this answer not opined based and I hope that I could give you some insights on how you can decide the best approach to use in a project.

Please, if someone can improve my answer feel free to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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