U
U
Underdoggit2018-05-22 19:43:05
Layout
Underdoggit, 2018-05-22 19:43:05

Which layout landing on Wordpress is more relevant and correct?

Ideologists of this CMS, explain which of these landings is correct, and the main essence of landing layout on CMS.
How I did it:
Designed the site manually, created function.php, style.css, etc., etc. with changing index.html -> .php with connecting all styles with scripts in wp_head, wp_footer. And then, through the ACF plugin, changing all text blocks and site images by connecting the script <?php the_field('random-class-name'); ?>- profit??
As many layout designers do:
Download any WordPress theme, remove everything from it, upload your code into it, connect plugins - profit??
I just started doing WordPress, and everyone does it differently - it’s not clear who is right, who is wrong, or is the whole point as in layout, where there are many ways to type and it’s all a matter of habit and taste?
If I'm wrong, and I'm talking nonsense, would it not be difficult for you to describe the algorithm for landing any layout on this CMS. Plus you in karma.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
O
Orkhan Hasanli, 2018-05-22
@azerphoenix

1) either use starter themes Example - https://understrap.com/ underscores.me
2) write from scratch, don't edit standard VP themes, etc.
3) about the settings page for the theme (Simple option - ACF, a more competent version of the framework). Framework example - redux framewor
https://reduxframework.com/ https://ru.wordpress.org/plugins/redux-framework/

M
Maxim Sharlaev, 2018-05-31
@entity1313

The right way is to follow the wordpress API and CMS features.
Throwing everything out of the standard theme and stuffing your code into it means either dooming the theme to death after someone clicks on the "update" button, or making the theme unupdatable. Well, and, accordingly, this is not the WP-way.
Before you do anything with a theme, you need to figure out if you are making a theme from scratch, or updating an existing one.
An existing theme is used if
a) only a few fixes are required - to fix the layout, add a few blocks
b) for some reason, even deep customization turns out to be easier (faster, easier) than development from scratch. Let's say the design of the theme is similar to what you need, you change the footer header a little, and the rest is uploaded through Visual Composer or a similar solution.
In this case, a child theme is created in which the main work takes place. As a result, updating the source theme is relatively painless for your code, and the child theme is maintained at the compatibility level with the source one (requires improvements about once a year if the theme is actively updated).
If you plan to develop a theme from scratch, then, as already noted, it would be optimal to take a ready-made starter theme like underscores. Making a theme from scratch makes sense if you don't want to drag a bunch of junk from an existing theme, or are developing something that doesn't fit well with existing variations.
Changeable blocks are made either through a visual editor (Visual Composer or others), or through the options mechanism, or through plugins like ACF. Moreover, it is not necessary to use ACF, WP has an interface for custom fields.
In terms of what to use - ACF, frameworks, or something else, the logic is something like this
: ) or the WP customizer. The latter seems to be the most correct and relevant to the development of WP - there is almost a stone's throw to visual editing already.
2. Page content - standard interface for custom fields, ACF or other solutions. With ACF, you need to be careful, it can run into server restrictions on the number of fields or give incorrect data (I wrote a backend for a mobile application through the WP REST API and took a sip from taxonomy-linked data saved through ACF)
In terms of code - everything that should be decided through the API is decided through the API. wp_enqueue_script/style for scripts and styles, wp_head(), wp_footer() in appropriate places. There are a lot of options to turn the development of a theme into a perversion, I have seen a lot of things from inexperienced developers. And there is simply no universal solution to avoid all this. In addition to learning, watching guides and best practices, keep an eye on WP updates and developer recommendations.

C
CODALSD, 2018-05-22
@CODALSD

And I do everything from scratch without any starting templates, at least this way I know exactly what I added and what not and everything works as it should

L
lukoie, 2018-05-23
@lukoie

Boilerplate is a more correct approach to vorpress-way.
Better yet, use child themes. Then a lot of what you need is already written in the parent one, and it will be updated for you, you only need to update it in the admin panel along with the plugins.
Although no one bothers to write your bike for two and a half files and hello.
It's like with a plugin - you can use one (!) file, or you can use the whole framework with OOP, the same thing (I just passed such a project right now).

S
shkuter, 2018-06-01
@shkuter

https://roots.io/sage/ for new themes, used by webpack to build the theme

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question