Use WordPress templates to tag target CSS for specific content

Front. Category- use the basics class. Therefore, our target is the category basics class, which is output by the body_class () template tag along with the body tag. Note: We used the class that contains the slog of the category. If your site has multiple users and you think they can change the logs, use the category ID class instead. The results archive page is as follows: The post title of the learn WP category archive page with a custom color can confirm that the category color, the border below each post and the background of the category description are used. I also added similar styles for three different categories. Load the summary fa1aa4761c93000017c54d62b657de25, which will add 3 colors. Green for necessities: there is a androg green lean WP essentials category archive page ultimate Red: androg lean WP ultimate category archive page (including red) finally, the application is yellow: the lean WP application category archive page with androg yellow looks good. However, let’s look at the post\u class () tag and use it to see the post\u class () method. Styles marked with post_class currently, my site has only color adjusted styles on the category archive page. However, you can also add styles that target a single post on the default blog page and use colors to highlight the category that the post belongs to. To do this, add the following to my style sheets: The impact of loading the summary fa1aa4761c93000017c54d62b657de25 on my blog page is as follows: If you need a learn WP blog page with custom colors by category, you can also add a style to the bottom border of each post or specify the post background color of this category. You are limited only by your imagination (and the boundaries of good design). The body and post classes provide more design control. This technique gives you better control over how to specify the style of your site. If you have clear categories to distinguish multiple parts of the site (such as business units or store parts), you can use these categories to create different shapes or brands for each part of the site. If fully considered, you can also use a multi site network with separate sites for each department of your company to save costs. How to specify a site style using body\u class() and post\u class() template tags? Tell us in the comments! Tags: subtopics CSS custom design

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *