WP theme development 05: WordPress theme template for writing static template of wordpress theme

1 year ago (2023-12-05) Chief Editor
6 minutes
two hundred and ninety-seven
zero

We want our customers to initially see the general effect of the wordpress theme thousands of miles away. Although the effect picture is beautiful, it is more intuitive and flexible to let customers see the general effect of the wordpress theme in the browser. After all, the customer's ultimate demand is to show the effect of the wordpress theme template on the website. However, developing a wordpress theme template is not a task that can be completed quickly, especially for those powerful wordpress theme templates, which involve many aspects. Therefore, in the early stage of development, it is impossible for us to do so and let customers see the effect of dynamic web pages.

Therefore, in the early stage, we can only ask the front-end engineer to combine the screenshots into a wordpress static code template through HTML and CSS code. This has two advantages:

1. It can make customers more intuitive to see the effect of WordPress theme on the website;

2. You can subtract the work of writing HTML static code by the backend engineer of the wordpress theme, and you can concentrate on writing PHP dynamic code.

So, how should front-end engineers write static code templates for wordpress topics?

1: Write according to some general specifications of the wordpress topic.

I once encountered such a situation. After the front-end engineer gave me the wordpress static code template, I encountered several places where it was not easy to use wordpress functions to achieve the same effect. For example, the top navigation menu. The wp_nav_menu() function provided by wordpress creates the menu list code as follows:

<li id="menu item 7164" class="menu item"><a target="_blank" href="/">Home Page</a></li>

<li id="menu item 7152" class="menu item"><a target="_blank" href="/">wordpress Enterprise Template</a></li>

<li id="menu item 7153" class="menu item"><a target="_blank" href="/">Wordpress CMS Topic</a></li>

Or directly use the "a" label:

<a target="_blank" href="/">Home Page</a>

<a target="_blank" href="/">Wordpress Enterprise Template</a>

<a target="_blank" href="/">Wordpress CMS Topic</a>

However, the code of the static template given to me by the front-end engineer uses div as the label of the menu list, as follows:

<div class="menu item"><a target="_blank" href="/">Home</a></div>

<div class="menu item"><a target="_blank" href="/">Wordpress Theme Template</a></div>

<div class="menu item"><a target="_blank" href="/">Wordpress Portal Theme</a></div>

Although we can use it through some related code processing, it will cost us development time. Isn't the goal of using wordpress programs to build websites is to make it easy and fast to develop? If the back-end engineer has to deal with this matter every time, it will affect the entire development progress. Therefore, when developing wordpress static templates, front-end engineers must follow the relevant wordpress specifications.

2: Develop several front-end static templates according to the renderings.

Front end developers generally only need to develop static templates according to the renderings provided by artists. When designing renderings, art designers are also based on the general needs of the website. A website, under normal circumstances, mainly includes: website homepage, website category directory page, website article details page, some independent pages (such as about us), and website search page. Of course, some websites have other pages. However, these are the main pages. Therefore, front-end engineers should prepare the following static templates:

1. Static code template on the homepage of the website;

2. The static template of the article list page;

3. The static template of the article details page;

4. Single page static template;

5. Static template of search page;

6. The static template of the tag page;

Of course, the above is a regular page static template. Different customers have different needs. For example, enterprise websites may need product display list pages, product sales pages, company promotion activity list pages, etc. These pages may be another page layout. Therefore, corresponding static templates should also be written for them.

In a word, you only need to pay attention to the above two points when writing the static code template of the wordpress theme. After all, the focus of wordpress theme development is on the writing of dynamic code. Most customer needs will be reflected in the dynamic code template of wordpress theme. Therefore, we will spend more time on the WordPress theme dynamic template.

This article is written by: Chief Editor Published on Cool theme , please indicate the source for reprinting: //hongchengtech.cn/blog/1845.html
Kuke_WP editor
author

Related recommendations

1 year ago (2024-02-20)

How does the WeChat management system manage enterprise WeChat chat content, and chat records of enterprise WeChat administrator permissions

Original title: How does the WeChat management system manage enterprise WeChat chat content How does the enterprise WeChat chat content manage enterprise WeChat chat content? Most WeChat chat content viewers on the market are for private viewing, but viewing WeChat chat content in enterprises is also particularly important. Without the use of WeChat management system, many behaviors such as abusing customers, flying orders, and randomly promising customers are
six hundred and fifty-six
zero
1 year ago (2024-02-20)

Liaocheng Chiping District Sub branch of Agricultural Development Bank of China carried out the second online exercise of the new generation credit management system, and how to do a good job in credit work as a member of Agricultural Development Bank of China

Recently, Chiping District Sub branch of Agricultural Development Bank of China actively implemented the second phase online exercise of the new generation credit management system. In accordance with the requirements of the overall exercise plan issued by the superior bank, it carefully deployed, carefully organized, clearly defined the division of labor, strengthened the coordination and linkage between various departments, closely cooperated, and effectively performed various work responsibilities during the exercise. Chiping District Sub branch organized all staff of the Customer Department to participate in the online drill
four hundred and eighty-seven
zero
1 year ago (2024-02-18)

Content marketing is hard to do? Zhiqu Baichuan teaches you how to easily build a content management system, and what needs to be done well in content marketing

Two days ago, we received an official email "to Baichuan to remove from the salesforce app store" - because the United States issued an administrative order on August 6, 2020, prohibiting "any WeChat related transactions", which came into effect 45 days after the administrative order was issued (that is, September 20). The "one-stop marketing cloud" provided by Zhiqu Baichuan includes
three hundred and thirty-nine
zero
1 year ago (2024-02-18)

Why Enterprise Content Management System?, Why did you choose Business Management

As paper has almost disappeared, your company's important documents and information need to be digitized, stored and used in a way that supports processes and workflows. Through the enterprise content management (ECM) system, you can better manage enterprise content and choose a more interactive way to process the information of the entire enterprise. Do you check the internal documents, invoices, training materials, contracts, finance
two hundred and eighty-three
zero

comment

0 people have participated in the review

Scan code to add WeChat

contact us

WeChat: Kuzhuti
Online consultation: