The form of my scope list convinced me to talk about Font Awesome Icons and custom CSS classes in bootScore, first. A pure HTML list is ugly, in my case: downright unreadable. No amount of rewording or restructuring helped. Shortening it was not an option either. It should continue to function as a complete scope statement. So I had to change its appearance.
Solution
- Font Awesome Icons
- Add
<i class="fa-regular fa-XYZ"></i>
etc. into Gutenberg block by editing it on the HTML level.1
- Add
- List without bullets (via bootstrap) [very simple]
- Add
list_unstyled
toBlock/Advanced/Additional CSS Classes
in the Gutenberg sidebar
- Add
- List without bullets (via self made CSS class) [simple]
- Insert
define('WP_ENVIRONMENT_TYPE', 'development');
into your filewp-config.php
- Add
.krNoBullets { list-style: none; }
to the filescss/_bscore_custom.scss
of your child theme. - Insert
krNoBullets
toBlock/Advanced/Additional CSS Classes
in the sidebar.
- Insert
- Uncomment
define('WP_ENVIRONMENT_TYPE', 'development');
in your filewp-config.php
.
Background
There are several ways to include Font Awesome in WordPress posts and pages. I could for example
- install a Font-Awesome-Plugin für WordPress and work with short codes,
- use a Font-Awesome-KIT
- or host the ‘fonts’ myself, let them load into bootScore-
header.php
, and include the icons as HTML tags into my text.
Fortunately, there is an easier way! bootScore already includes Font Awesome.2 From there, fontawesome/css/all.min.css
is loaded into the header.php
file via a style-sheet link, i.e. not downloaded from an external source. So, nobody can get notifications if my reader looks at the icons embedded by me. Hence, bootScore may legitimately say it had set up the usage GPDR friendly: If no data is given to third parties in this respect, I don’t need to say anything about Font Awesome in my privacy policy.
That reduces my effort to embed the i‑tags into the Gutenberg blocks on the HTML level:
<ul>
<!-- wp:list-item -->
<li>
<i class="fa-regular fa-square-check"></i>
include Font Awesome Symbols via bootScore</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>
<i class="fa-regular fa-square"></i>
include locally installed Google fonts</li>
<!-- /wp:list-item -->
</ul>
Here is the result:
- include Font Awesome Symbols via bootScore
- include locally installed Google fonts
However, it is unpleasant that the bullet points are still visible. That disturbs with a checklist. So I still have to persuade the list via <ul src="list-style-type:none!>
etc. to handle this differently. Doing this in Gutenberg directly at the HTML level doesn’t really work. It would be better if I had a corresponding css class in the bootScore file that is responsible for me: _bscore_custom.scss
To realize that, I have to learn how bootScore handles css customizations:
- ‘Of course’ I only edit files in my child theme.3
- Also, I edit only the scss files, not any css file. This is because bootScore comes with an scss compiler that recompiles all css files from the scss files.4
- So I add my definition
.krNoBullets { list-style: none; }
to the file_bscore_custom.scss
. 5 - Finally, I force
main.css
to be recompiled for every change in_bscore_custom.scss
by adding the linedefine('WP_ENVIRONMENT_TYPE', 'development');
to mywp-config.php
file. - And I don’t forget to comment out the line
define('WP_ENVIRONMENT_TYPE', 'development');
at the end. 6
This is the result:
- include Font Awesome Symbols via bootScore
- include locally installed Google fonts
However, there is a much easier way to do this: Bootstrap as the base of bootScore comes with ready-to-use class definitions. And since bootScore contains Bootstrap, these classes can also be assigned directly to a block via Gutenberg, e.g. the class list-unstyled
to a list block.
And how does this …
… support our migration to bootScore? Well, if a web designer must abandon her current WordPress theme, she needs a replacement. A free ‘off-the-shelf’ theme, she probably wants to personalize. First a bit cosmetically, then in terms of the gray value of her pages, multilingualism and internal reference techniques and linking. Finally, she perhaps enables special footers, a secondary menu or a copyright notice before checking the SEO features of the selected theme. This is a way that this post supports too.
- After having activated Shortcodes for Font Awesome you can directly insert [bsfa fa-regular fa-XYZ] via Gutenberg. [↩]
- see
bootscore-main/fontawesome
[↩] - Otherwise, my modifications would disappear with every update of themes
bootscore-main
. [↩] - If I did otherwise, my additions would disappear again with each compiler run. [↩]
- It is already included in the set of files relevant to the compilation run. [↩]
- Otherwise, my site would run really slow. [↩]