rzelnik
Forum Replies Created
-
Forum: Requests and Feedback
In reply to: Multi-language capabilities of WordPressThanks @threadi for your answer. I know both WPML and Polylang. The Long term roadmap is promising, thank you for mentioning it.
Forum: Fixing WordPress
In reply to: Why are the theme files organized like this?Ok @joyously , thanks for your answer.
Forum: Fixing WordPress
In reply to: Why are the theme files organized like this?Yes, I understand. In this case you can use conditional load or multiple layout templates. The point is that the page layout code is not splitted into two separate files, so it is easier to read.
Forum: Fixing WordPress
In reply to: Why are the theme files organized like this?@mattyrob Thank your for your answer. What redundant code do you mean? Actually the current scheme creates redundancy. You need to load header, sidebar, footer in each template. With the layout > content scheme you only need to load them once – in the layout template. For example:
core:
$template = "index.php"; // or 404.php, archive.php, single.php etc. include "layout.php";
layout.php
<!doctype html> <html> <head> ... </head> <body> <?php get_header(); include $template; get_sidebar(); get_footer(); ?> </body> </html>
Most of the CMSes and web application frameworks use this scheme, and in my opinion it works better. You can use multiple different layout files when needed, of course.
- This reply was modified 4 years, 10 months ago by rzelnik.
Forum: Fixing WordPress
In reply to: Why are wordpress theme templates divided?In this case, the header.php content would be:
<header ...> ... </header>
and footer.php:
<footer ...> ... </footer>
Forum: Fixing WordPress
In reply to: Why are wordpress theme templates divided?Yes, I understand that they are the same on all templates. I do not suggest to copy the header and footer content on all templates. I suggest to create one undivided layout template, like this:
layout.php
<html> <head> ... </head> <body> ... <?php get_header(); ?> ... <?php get_main_content(); ?> ... <?php get_sidebar(); ?> <?php get_footer(); ?> ... </body> </html>
This structure would be more consistend, since it’s all in one code.
Great, thanks for quick resolving.