Home > CMS Tutorial > WordPress > body text

The difference between wordpress themes and plugins

(*-*)浩
Release: 2019-07-13 13:28:58
Original
2749 people have browsed it

The theme is responsible for display, but does not involve functional changes. Otherwise, some functions will become invalid after the user switches themes.

The difference between wordpress themes and plugins

This is why I have never seen a theme with a like function. It turns out that this should be a plug-in category.

Plugins are packages of code that extend the core functionality of WordPress. WordPress plugins are made up of PHP 
code and other assets such as images, CSS, and JavaScript.
Copy after login

The plug-in is responsible for adding functional logic. For example, a shopping cart plugin. Plugins can use their functionality after activation.

Add routine to create a new data table storage plug-in configuration

These operations are not recommended by the theme.

Custom Post Type

Since plug-ins are more suitable for functional expansion, the new Custom Post Type should theoretically be implemented in the plug-in. For example, create a new CPT in activation.

However, the question arises, if you use a plug-in to create a new CPT, where is the front-end display logic of the CPT implemented? If you implement it in a theme, there will be a problem that CPT disappears when you change the theme; if you implement it in a plug-in, it feels weird. . .

But judging from the example given in Working with Custom Post Types in the wordpress plugin handbook, the display of CPT is still in the plugin.

Where is the display logic written? Where is the functional logic written? The answer is not absolute.

For one-time functions with no reuse value, or temporary websites, you can write whatever you want. As long as it can go online quickly enough.

For more wordpress related technical articles, please visit the wordpress tutorial column to learn!

The above is the detailed content of The difference between wordpress themes and plugins. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template