Init commit
This commit is contained in:
21
.editorconfig
Normal file
21
.editorconfig
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# This file is for unifying the coding style for different editors and IDEs
|
||||||
|
# https://editorconfig.org/
|
||||||
|
|
||||||
|
# WordPress Coding Standards
|
||||||
|
# https://make.wordpress.org/core/handbook/coding-standards/
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Ignore dependencies from npm and Composer:
|
||||||
|
/node_modules
|
||||||
|
/vendor
|
||||||
|
/.idea
|
||||||
|
# Ignore generated JavaScript files:
|
||||||
|
*.min.js
|
||||||
|
|
||||||
|
# Ignore generated CSS files:
|
||||||
|
style.css
|
||||||
|
style-editor.css
|
||||||
|
style-editor-extra.css
|
||||||
|
|
||||||
|
# Ignore the generated zip file:
|
||||||
|
familiarosatheme.zip
|
||||||
|
|
||||||
|
# Ignore .DS_Store files from macOS:
|
||||||
|
.DS_Store
|
||||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
31
.idea/familiarosatheme.iml
generated
Normal file
31
.idea/familiarosatheme.iml
generated
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/dealerdirect/phpcodesniffer-composer-installer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/eftec/bladeone" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/gettext/gettext" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/gettext/languages" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/mck89/peast" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/mustache/mustache" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcompatibility/php-compatibility" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcompatibility/phpcompatibility-paragonie" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcompatibility/phpcompatibility-wp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcsstandards/phpcsextra" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcsstandards/phpcsutils" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sirbrillig/phpcs-changed" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sirbrillig/phpcs-variable-analysis" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/squizlabs/php_codesniffer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-cli/i18n-command" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-cli/mustangostang-spyc" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-cli/php-cli-tools" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-cli/wp-cli" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-coding-standards/wpcs" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
7
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
7
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="PhpCSValidationInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/familiarosatheme.iml" filepath="$PROJECT_DIR$/.idea/familiarosatheme.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
67
.idea/php.xml
generated
Normal file
67
.idea/php.xml
generated
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="MessDetectorOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PHPCSFixerOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PHPCodeSnifferOptionsConfiguration">
|
||||||
|
<option name="codingStandard" value="Custom" />
|
||||||
|
<option name="customRuleset" value="$PROJECT_DIR$/phpcs.xml.dist" />
|
||||||
|
<option name="highlightLevel" value="WARNING" />
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PhpCodeSniffer">
|
||||||
|
<phpcs_settings>
|
||||||
|
<PhpCSConfiguration beautifier_path="$PROJECT_DIR$/vendor/bin/phpcbf" tool_path="$PROJECT_DIR$/vendor/bin/phpcs" />
|
||||||
|
<phpcs_by_interpreter asDefaultInterpreter="true" interpreter_id="a00f9222-ae2e-4a79-bc79-28a6de603b4a" timeout="30000" />
|
||||||
|
</phpcs_settings>
|
||||||
|
</component>
|
||||||
|
<component name="PhpIncludePathManager">
|
||||||
|
<include_path>
|
||||||
|
<path value="$PROJECT_DIR$/vendor/wp-cli/i18n-command" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sirbrillig/phpcs-variable-analysis" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/wp-cli/wp-cli" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sirbrillig/phpcs-changed" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/squizlabs/php_codesniffer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/mck89/peast" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/gettext/languages" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/gettext/gettext" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/mustache/mustache" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpcompatibility/php-compatibility" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpcompatibility/phpcompatibility-wp" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/eftec/bladeone" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpcompatibility/phpcompatibility-paragonie" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/dealerdirect/phpcodesniffer-composer-installer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpcsstandards/phpcsutils" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpcsstandards/phpcsextra" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/wp-cli/php-cli-tools" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/wp-cli/mustangostang-spyc" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/wp-coding-standards/wpcs" />
|
||||||
|
</include_path>
|
||||||
|
</component>
|
||||||
|
<component name="PhpStan">
|
||||||
|
<PhpStan_settings>
|
||||||
|
<phpstan_by_interpreter asDefaultInterpreter="true" interpreter_id="a00f9222-ae2e-4a79-bc79-28a6de603b4a" timeout="60000" />
|
||||||
|
</PhpStan_settings>
|
||||||
|
</component>
|
||||||
|
<component name="PhpStanOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PhpUnit">
|
||||||
|
<phpunit_settings>
|
||||||
|
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" />
|
||||||
|
</phpunit_settings>
|
||||||
|
</component>
|
||||||
|
<component name="Psalm">
|
||||||
|
<Psalm_settings>
|
||||||
|
<psalm_fixer_by_interpreter asDefaultInterpreter="true" interpreter_id="a00f9222-ae2e-4a79-bc79-28a6de603b4a" timeout="60000" />
|
||||||
|
</Psalm_settings>
|
||||||
|
</component>
|
||||||
|
<component name="PsalmOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
10
.idea/phpspec.xml
generated
Normal file
10
.idea/phpspec.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PHPSpec">
|
||||||
|
<suites>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
</suites>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/prettier.xml
generated
Normal file
6
.idea/prettier.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PrettierConfiguration">
|
||||||
|
<option name="myConfigurationMode" value="AUTOMATIC" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
1
.node-version
Normal file
1
.node-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
22
|
||||||
11
.prettierignore
Normal file
11
.prettierignore
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Ignore all files:
|
||||||
|
*.*
|
||||||
|
|
||||||
|
# Negate the above pattern for CSS files in the `tailwind` folder and for
|
||||||
|
# all JavaScript files:
|
||||||
|
!tailwind/**/*.css
|
||||||
|
!*.js
|
||||||
|
!*.mjs
|
||||||
|
|
||||||
|
# Ignore minified JavaScript:
|
||||||
|
*.min.js
|
||||||
339
LICENSE
Normal file
339
LICENSE
Normal file
@@ -0,0 +1,339 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if you
|
||||||
|
distribute copies of the software, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
|
you have. You must make sure that they, too, receive or can get the
|
||||||
|
source code. And you must show them these terms so they know their
|
||||||
|
rights.
|
||||||
|
|
||||||
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
|
distribute and/or modify the software.
|
||||||
|
|
||||||
|
Also, for each author's protection and ours, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
software. If the software is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original, so
|
||||||
|
that any problems introduced by others will not reflect on the original
|
||||||
|
authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that redistributors of a free
|
||||||
|
program will individually obtain patent licenses, in effect making the
|
||||||
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License applies to any program or other work which contains
|
||||||
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
|
under the terms of this General Public License. The "Program", below,
|
||||||
|
refers to any such program or work, and a "work based on the Program"
|
||||||
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
|
source code as you receive it, in any medium, provided that you
|
||||||
|
conspicuously and appropriately publish on each copy an appropriate
|
||||||
|
copyright notice and disclaimer of warranty; keep intact all the
|
||||||
|
notices that refer to this License and to the absence of any warranty;
|
||||||
|
and give any other recipients of the Program a copy of this License
|
||||||
|
along with the Program.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy, and
|
||||||
|
you may at your option offer warranty protection in exchange for a fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Program or any portion
|
||||||
|
of it, thus forming a work based on the Program, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) You must cause the modified files to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
b) You must cause any work that you distribute or publish, that in
|
||||||
|
whole or in part contains or is derived from the Program or any
|
||||||
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
|
parties under the terms of this License.
|
||||||
|
|
||||||
|
c) If the modified program normally reads commands interactively
|
||||||
|
when run, you must cause it, when started running for such
|
||||||
|
interactive use in the most ordinary way, to print or display an
|
||||||
|
announcement including an appropriate copyright notice and a
|
||||||
|
notice that there is no warranty (or else, saying that you provide
|
||||||
|
a warranty) and that users may redistribute the program under
|
||||||
|
these conditions, and telling the user how to view a copy of this
|
||||||
|
License. (Exception: if the Program itself is interactive but
|
||||||
|
does not normally print such an announcement, your work based on
|
||||||
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Program,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Program, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Program.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Program
|
||||||
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
|
under Section 2) in object code or executable form under the terms of
|
||||||
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
|
a) Accompany it with the complete corresponding machine-readable
|
||||||
|
source code, which must be distributed under the terms of Sections
|
||||||
|
1 and 2 above on a medium customarily used for software interchange; or,
|
||||||
|
|
||||||
|
b) Accompany it with a written offer, valid for at least three
|
||||||
|
years, to give any third party, for a charge no more than your
|
||||||
|
cost of physically performing source distribution, a complete
|
||||||
|
machine-readable copy of the corresponding source code, to be
|
||||||
|
distributed under the terms of Sections 1 and 2 above on a medium
|
||||||
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
|
c) Accompany it with the information you received as to the offer
|
||||||
|
to distribute corresponding source code. (This alternative is
|
||||||
|
allowed only for noncommercial distribution and only if you
|
||||||
|
received the program in object code or executable form with such
|
||||||
|
an offer, in accord with Subsection b above.)
|
||||||
|
|
||||||
|
The source code for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For an executable work, complete source
|
||||||
|
code means all the source code for all modules it contains, plus any
|
||||||
|
associated interface definition files, plus the scripts used to
|
||||||
|
control compilation and installation of the executable. However, as a
|
||||||
|
special exception, the source code distributed need not include
|
||||||
|
anything that is normally distributed (in either source or binary
|
||||||
|
form) with the major components (compiler, kernel, and so on) of the
|
||||||
|
operating system on which the executable runs, unless that component
|
||||||
|
itself accompanies the executable.
|
||||||
|
|
||||||
|
If distribution of executable or object code is made by offering
|
||||||
|
access to copy from a designated place, then offering equivalent
|
||||||
|
access to copy the source code from the same place counts as
|
||||||
|
distribution of the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
|
except as expressly provided under this License. Any attempt
|
||||||
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
|
void, and will automatically terminate your rights under this License.
|
||||||
|
However, parties who have received copies, or rights, from you under
|
||||||
|
this License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
5. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Program or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Program (or any work based on the
|
||||||
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Program or works based on it.
|
||||||
|
|
||||||
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
|
Program), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute or modify the Program subject to
|
||||||
|
these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
7. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Program at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Program by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Program.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under
|
||||||
|
any particular circumstance, the balance of the section is intended to
|
||||||
|
apply and the section as a whole is intended to apply in other
|
||||||
|
circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system, which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Program under this License
|
||||||
|
may add an explicit geographical distribution limitation excluding
|
||||||
|
those countries, so that distribution is permitted only in or among
|
||||||
|
countries not thus excluded. In such case, this License incorporates
|
||||||
|
the limitation as if written in the body of this License.
|
||||||
|
|
||||||
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies a version number of this License which applies to it and "any
|
||||||
|
later version", you have the option of following the terms and conditions
|
||||||
|
either of that version or of any later version published by the Free
|
||||||
|
Software Foundation. If the Program does not specify a version number of
|
||||||
|
this License, you may choose any version ever published by the Free Software
|
||||||
|
Foundation.
|
||||||
|
|
||||||
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
|
programs whose distribution conditions are different, write to the author
|
||||||
|
to ask for permission. For software which is copyrighted by the Free
|
||||||
|
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||||
|
make exceptions for this. Our decision will be guided by the two goals
|
||||||
|
of preserving the free status of all derivatives of our free software and
|
||||||
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||||
|
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||||
|
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||||
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||||
|
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||||
|
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||||
|
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||||
|
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
{description}
|
||||||
|
Copyright (C) {year} {fullname}
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program is interactive, make it output a short notice like this
|
||||||
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, the commands you use may
|
||||||
|
be called something other than `show w' and `show c'; they could even be
|
||||||
|
mouse-clicks or menu items--whatever suits your program.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
|
{signature of Ty Coon}, 1 April 1989
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
This General Public License does not permit incorporating your program into
|
||||||
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
|
consider it more useful to permit linking proprietary applications with the
|
||||||
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License.
|
||||||
61
README.md
Normal file
61
README.md
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
FamiliaRosaTheme
|
||||||
|
================
|
||||||
|
|
||||||
|
A custom theme based on \_tw
|
||||||
|
|
||||||
|
## Quickstart
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
1. Move this folder to `wp-content/themes` in your local development environment
|
||||||
|
2. Run `npm install && npm run dev` in this folder
|
||||||
|
3. Activate this theme in your local WordPress installation
|
||||||
|
|
||||||
|
### Development
|
||||||
|
|
||||||
|
4. Run `npm run watch`
|
||||||
|
5. Add [Tailwind utility classes](https://tailwindcss.com/docs/utility-first) with abandon
|
||||||
|
|
||||||
|
### Deployment
|
||||||
|
|
||||||
|
6. Run `npm run bundle`
|
||||||
|
7. Upload the resulting zip file to your site using the “Upload Theme” button on the “Add Themes” administration page
|
||||||
|
|
||||||
|
Or [deploy with the tool of your choice](https://underscoretw.com/docs/deployment/#h-other-deployment-options)!
|
||||||
|
|
||||||
|
## Full Documentation
|
||||||
|
|
||||||
|
### Fundamentals
|
||||||
|
|
||||||
|
* [Installation](https://underscoretw.com/docs/installation/)
|
||||||
|
Generate your custom theme, install it in WordPress and run your first Tailwind builds
|
||||||
|
* [Development](https://underscoretw.com/docs/development/)
|
||||||
|
Watch for changes, build for production and learn more about how _tw, WordPress and Tailwind work together
|
||||||
|
* [Deployment](https://underscoretw.com/docs/deployment/)
|
||||||
|
Share your new WordPress theme with the world
|
||||||
|
* [Troubleshooting](https://underscoretw.com/docs/troubleshooting/)
|
||||||
|
Find solutions to potential issues and answers to frequently asked questions
|
||||||
|
|
||||||
|
### In Depth
|
||||||
|
|
||||||
|
* [Using Tailwind Typography](https://underscoretw.com/docs/tailwind-typography/)
|
||||||
|
Customize front-end and back-end typographic styles
|
||||||
|
* [JavaScript Bundling with esbuild](https://underscoretw.com/docs/esbuild/)
|
||||||
|
Install and bundle JavaScript libraries (very quickly)
|
||||||
|
* [Adding custom fonts](https://underscoretw.com/docs/custom-fonts/)
|
||||||
|
Host your fonts yourself or use a third party—and then add those fonts to your WordPress theme
|
||||||
|
* [Linting and Code Formatting](https://underscoretw.com/docs/linting-code-formatting/)
|
||||||
|
Catch bugs and stop thinking about formatting
|
||||||
|
* [Keeping your theme up-to-date](https://underscoretw.com/docs/updating/)
|
||||||
|
How to update (and whether or not you should)
|
||||||
|
|
||||||
|
### Extras
|
||||||
|
|
||||||
|
* [On Tailwind and WordPress](https://underscoretw.com/docs/wordpress-tailwind/)
|
||||||
|
Understand how WordPress and Tailwind work together
|
||||||
|
* [Styling HTML from outside the theme](https://underscoretw.com/docs/styling-html-from-outside-the-theme/)
|
||||||
|
Work with WordPress core, plugins and JavaScript libraries
|
||||||
|
* [Managing Styles for Custom Blocks](https://underscoretw.com/docs/custom-blocks/)
|
||||||
|
Learn strategies for using Tailwind in theme-specific custom blocks
|
||||||
|
* [Setting Up Browsersync](https://underscoretw.com/docs/browsersync/)
|
||||||
|
Add live reloads and synchronized cross-device testing to your workflow
|
||||||
22
composer.json
Normal file
22
composer.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"require-dev": {
|
||||||
|
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
|
||||||
|
"phpcompatibility/phpcompatibility-wp": "^2.1",
|
||||||
|
"sirbrillig/phpcs-changed": "^2.11",
|
||||||
|
"sirbrillig/phpcs-variable-analysis": "^2.11",
|
||||||
|
"wp-cli/i18n-command": "^2.6",
|
||||||
|
"wp-coding-standards/wpcs": "^3.1"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"php:lint": "vendor/bin/phpcs -p -s",
|
||||||
|
"php:lint:errors": "vendor/bin/phpcs -p -s --runtime-set ignore_warnings_on_exit 1",
|
||||||
|
"php:lint:autofix": "vendor/bin/phpcbf",
|
||||||
|
"php:lint:changed": "vendor/bin/phpcs-changed --git --git-unstaged",
|
||||||
|
"make-pot": "wp i18n make-pot . theme/languages/familiarosatheme.pot"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"allow-plugins": {
|
||||||
|
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1353
composer.lock
generated
Normal file
1353
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
43
eslint.config.mjs
Normal file
43
eslint.config.mjs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import globals from 'globals';
|
||||||
|
import js from '@eslint/js';
|
||||||
|
import prettier from 'eslint-config-prettier';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
ignores: ['**/*.min.js', '**/vendor/'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.{js,mjs}'],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 'latest',
|
||||||
|
sourceType: 'script',
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...js.configs.recommended.rules,
|
||||||
|
...prettier.rules,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['javascript/**/*.js', '**/*.mjs'],
|
||||||
|
languageOptions: {
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['javascript/**/*.js'],
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
wp: 'readonly',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['node_scripts/*.js', 'tailwind/*.js'],
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.node,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
38
javascript/block-editor.js
Normal file
38
javascript/block-editor.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* Block editor modifications
|
||||||
|
*
|
||||||
|
* This file is loaded only by the block editor. Use it to modify the block
|
||||||
|
* editor via its APIs.
|
||||||
|
*
|
||||||
|
* The JavaScript code you place here will be processed by esbuild, and the
|
||||||
|
* output file will be created at `../theme/js/block-editor.min.js` and
|
||||||
|
* enqueued in `../theme/functions.php`.
|
||||||
|
*
|
||||||
|
* For esbuild documentation, please see:
|
||||||
|
* https://esbuild.github.io/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This import adds your front-end post title and Tailwind Typography classes
|
||||||
|
* to the block editor. It also adds some helper classes so you can access the
|
||||||
|
* post type when modifying the block editor’s appearance.
|
||||||
|
*/
|
||||||
|
import '@_tw/typography/block-editor-classes';
|
||||||
|
|
||||||
|
wp.domReady(() => {
|
||||||
|
/**
|
||||||
|
* Add support for Tailwind Typography’s `lead` class via a block style.
|
||||||
|
*/
|
||||||
|
wp.blocks.registerBlockStyle('core/paragraph', {
|
||||||
|
name: 'lead',
|
||||||
|
label: 'Lead',
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add additional block editor modifications here. For example, you could
|
||||||
|
// register another block style:
|
||||||
|
//
|
||||||
|
// wp.blocks.registerBlockStyle( 'core/quote', {
|
||||||
|
// name: 'fancy-quote',
|
||||||
|
// label: 'Fancy Quote',
|
||||||
|
// } );
|
||||||
|
});
|
||||||
10
javascript/script.js
Normal file
10
javascript/script.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* Front-end JavaScript
|
||||||
|
*
|
||||||
|
* The JavaScript code you place here will be processed by esbuild. The output
|
||||||
|
* file will be created at `../theme/js/script.min.js` and enqueued in
|
||||||
|
* `../theme/functions.php`.
|
||||||
|
*
|
||||||
|
* For esbuild documentation, please see:
|
||||||
|
* https://esbuild.github.io/
|
||||||
|
*/
|
||||||
90
node_scripts/zip.js
Normal file
90
node_scripts/zip.js
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Based upon the Archiver quickstart.
|
||||||
|
* @see: https://www.archiverjs.com/docs/quickstart
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Require modules.
|
||||||
|
const AdmZip = require('adm-zip');
|
||||||
|
const archiver = require('archiver');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const args = process.argv.slice(2);
|
||||||
|
const slug = args[0];
|
||||||
|
|
||||||
|
if (slug) {
|
||||||
|
// Set the path for the ZIP file.
|
||||||
|
const zipFilePath = __dirname + '/../' + slug + '.zip';
|
||||||
|
|
||||||
|
// Create a file to stream archive data to.
|
||||||
|
const output = fs.createWriteStream(zipFilePath);
|
||||||
|
const archive = archiver('zip');
|
||||||
|
|
||||||
|
// Listen for all archive data to be written.
|
||||||
|
output.on('close', function () {
|
||||||
|
console.log(archive.pointer() + ' total bytes.');
|
||||||
|
console.log('Theme ZIP file created.');
|
||||||
|
|
||||||
|
// Read the zip file.
|
||||||
|
const zip = new AdmZip(zipFilePath);
|
||||||
|
|
||||||
|
// Load `./functions.php` from the zip file.
|
||||||
|
const entry = zip.getEntry(slug + '/functions.php');
|
||||||
|
|
||||||
|
if (entry) {
|
||||||
|
// Get the contents of `./functions.php`.
|
||||||
|
const originalContent = zip.readAsText(entry);
|
||||||
|
|
||||||
|
// Replace the version string with a date-based version string.
|
||||||
|
const updatedContent = originalContent.replace(
|
||||||
|
/(define\( '[A-Z0-9_]*_VERSION', ')(.*)(' \);)/g,
|
||||||
|
'$1' +
|
||||||
|
parseInt(Math.floor(Date.now() / 1000), 10).toString(36) +
|
||||||
|
'$3'
|
||||||
|
);
|
||||||
|
|
||||||
|
// Update the contents of `./functions.php`.
|
||||||
|
zip.updateFile(entry, Buffer.from(updatedContent));
|
||||||
|
|
||||||
|
// Write the changes back to the zip file.
|
||||||
|
zip.writeZip(zipFilePath);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
'Date-based versioning string successfully added to `./functions.php`.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// This event is fired when the data source is drained no matter what was the data source.
|
||||||
|
// It is not part of this library but rather from the NodeJS Stream API.
|
||||||
|
// @see: https://nodejs.org/api/stream.html#stream_event_end
|
||||||
|
output.on('end', function () {
|
||||||
|
console.log('Data has been drained');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Catch warnings.
|
||||||
|
archive.on('warning', function (err) {
|
||||||
|
if (err.code === 'ENOENT') {
|
||||||
|
// log warning
|
||||||
|
} else {
|
||||||
|
// throw error
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Catch errors.
|
||||||
|
archive.on('error', function (err) {
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Pipe archive data to the file.
|
||||||
|
archive.pipe(output);
|
||||||
|
|
||||||
|
// Append the entire contents of the theme directory to a directory with
|
||||||
|
// the theme slug.
|
||||||
|
archive.directory(__dirname + '/../theme/', slug);
|
||||||
|
|
||||||
|
// Finalize the archive.
|
||||||
|
archive.finalize();
|
||||||
|
}
|
||||||
5542
package-lock.json
generated
Normal file
5542
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
46
package.json
Normal file
46
package.json
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"devDependencies": {
|
||||||
|
"@_tw/typography": "^0.5.17",
|
||||||
|
"@tailwindcss/cli": "^4.0.0",
|
||||||
|
"@wordpress/prettier-config": "^4.16.0",
|
||||||
|
"adm-zip": "^0.5.16",
|
||||||
|
"archiver": "^7.0.1",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"esbuild": "^0.24.2",
|
||||||
|
"eslint": "^9.18.0",
|
||||||
|
"eslint-config-prettier": "^10.0.1",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"prettier": "^3.4.2",
|
||||||
|
"prettier-plugin-tailwindcss": "^0.6.10",
|
||||||
|
"tailwindcss": "^4.0.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"development:tailwind:frontend": "npx @tailwindcss/cli -i ./tailwind/tailwind.css -o ./theme/style.css",
|
||||||
|
"development:tailwind:editor": "cross-env _TW_TARGET=editor npx @tailwindcss/cli -i ./tailwind/tailwind-editor.css -o ./theme/style-editor.css",
|
||||||
|
"development:tailwind:editor:extra": "npx @tailwindcss/cli -i tailwind/tailwind-editor-extra.css -o ./theme/style-editor-extra.css",
|
||||||
|
"development:esbuild": "npx esbuild ./javascript/script.js ./javascript/block-editor.js --target=esnext --bundle --outdir=./theme/js --out-extension:.js=.min.js",
|
||||||
|
"development": "run-p \"development:**\"",
|
||||||
|
"dev": "npm run development",
|
||||||
|
"watch:tailwind:frontend": "npm run development:tailwind:frontend -- --watch",
|
||||||
|
"watch:tailwind:editor": "npm run development:tailwind:editor -- --watch",
|
||||||
|
"watch:tailwind:editor:extra": "npm run development:tailwind:editor:extra -- --watch",
|
||||||
|
"watch:esbuild": "npm run development:esbuild -- --watch",
|
||||||
|
"watch": "run-p \"watch:**\"",
|
||||||
|
"lint:eslint": "npx eslint",
|
||||||
|
"lint:prettier": "npx prettier --check .",
|
||||||
|
"lint": "run-p \"lint:*\"",
|
||||||
|
"lint-fix:eslint": "npx eslint --fix",
|
||||||
|
"lint-fix:prettier": "npx prettier --write .",
|
||||||
|
"lint-fix": "run-p \"lint-fix:*\"",
|
||||||
|
"production:tailwind:frontend": "npm run development:tailwind:frontend -- --minify",
|
||||||
|
"production:tailwind:editor": "npm run development:tailwind:editor -- --minify",
|
||||||
|
"production:tailwind:editor:extra": "npm run development:tailwind:editor:extra -- --minify",
|
||||||
|
"production:esbuild": "npm run development:esbuild -- --minify",
|
||||||
|
"production": "run-p \"production:**\"",
|
||||||
|
"prod": "npm run production",
|
||||||
|
"zip": "node node_scripts/zip.js familiarosatheme",
|
||||||
|
"bundle": "run-s production zip"
|
||||||
|
},
|
||||||
|
"prettier": "@wordpress/prettier-config"
|
||||||
|
}
|
||||||
89
phpcs.xml.dist
Normal file
89
phpcs.xml.dist
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="FamiliaRosaTheme" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
|
||||||
|
|
||||||
|
<description>A set of rules to check for a custom WordPress theme</description>
|
||||||
|
<!-- Based on the `phpcs.xml.dist.sample` file from the WordPress Coding Standards. -->
|
||||||
|
|
||||||
|
<!-- Pass some flags to PHPCS:
|
||||||
|
p flag: Show progress of the run.
|
||||||
|
s flag: Show sniff codes in all reports.
|
||||||
|
-->
|
||||||
|
<arg value="ps"/>
|
||||||
|
|
||||||
|
<!-- Strip the file paths down to the relevant bit. -->
|
||||||
|
<arg name="basepath" value="./"/>
|
||||||
|
|
||||||
|
<!-- Check up to 8 files simultaneously. -->
|
||||||
|
<arg name="parallel" value="8"/>
|
||||||
|
|
||||||
|
<!-- Check PHP files only. JavaScript and CSS files are checked separately. -->
|
||||||
|
<arg name="extensions" value="php"/>
|
||||||
|
|
||||||
|
<!-- Check all files in this directory and the directories below it. -->
|
||||||
|
<file>.</file>
|
||||||
|
|
||||||
|
<!-- Exclude patterns. -->
|
||||||
|
<exclude-pattern>/vendor/*</exclude-pattern>
|
||||||
|
<exclude-pattern>/node_modules/*</exclude-pattern>
|
||||||
|
|
||||||
|
<!-- Include the WordPress-Extra standard. -->
|
||||||
|
<rule ref="WordPress-Extra">
|
||||||
|
<!--
|
||||||
|
We may want a middle ground, though. The best way to do this is to add
|
||||||
|
the entire ruleset, then remove rules that don't suit a project. We can
|
||||||
|
do this by running `phpcs` with the '-s' flag, which allows us to see
|
||||||
|
the names of the sniffs reporting errors.
|
||||||
|
|
||||||
|
Once we know the sniff names, we can opt to exclude sniffs which don't
|
||||||
|
suit our project.
|
||||||
|
|
||||||
|
The examples below demonstrate how you can exclude rules. They are not
|
||||||
|
intended as advice about which sniffs to exclude.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing"/>
|
||||||
|
<exclude name="WordPress.Security.EscapeOutput"/>
|
||||||
|
-->
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- Let's also check that everything is properly documented. -->
|
||||||
|
<rule ref="WordPress-Docs"/>
|
||||||
|
|
||||||
|
<!-- Check for PHP cross-version compatibility. -->
|
||||||
|
<config name="testVersion" value="7.4-"/>
|
||||||
|
<rule ref="PHPCompatibilityWP"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
To get the optimal benefits of using the WordPress Coding Standards, we
|
||||||
|
should add a couple of custom properties.
|
||||||
|
|
||||||
|
For information on additional custom properties available, check out
|
||||||
|
the wiki:
|
||||||
|
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
|
||||||
|
-->
|
||||||
|
<config name="minimum_supported_wp_version" value="6.2"/>
|
||||||
|
|
||||||
|
<rule ref="WordPress.WP.I18n">
|
||||||
|
<properties>
|
||||||
|
<property name="text_domain" type="array">
|
||||||
|
<element value="familiarosatheme"/>
|
||||||
|
</property>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
|
||||||
|
<properties>
|
||||||
|
<property name="prefixes" type="array">
|
||||||
|
<element value="familiarosatheme"/>
|
||||||
|
</property>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule ref="WordPress.Files.FileName">
|
||||||
|
<properties>
|
||||||
|
<property name="is_theme" value="true"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
</ruleset>
|
||||||
11
tailwind/custom/base.css
Normal file
11
tailwind/custom/base.css
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Custom styles to immediately follow Tailwind’s `base` layer
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This uses the background and foreground colors declared in the `theme.json`
|
||||||
|
* file and is applied both to the front end and in the block editor.
|
||||||
|
*/
|
||||||
|
body {
|
||||||
|
@apply bg-background text-foreground font-sans;
|
||||||
|
}
|
||||||
56
tailwind/custom/components/components.css
Normal file
56
tailwind/custom/components/components.css
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
/**
|
||||||
|
* Custom styles to immediately follow Tailwind’s `components` layer
|
||||||
|
*
|
||||||
|
* “Add more opinionated, complex classes like buttons, form controls, alerts,
|
||||||
|
* etc; the sort of pre-built components you often see in other frameworks that
|
||||||
|
* you might need to override with utility classes.”
|
||||||
|
*
|
||||||
|
* — from https://tailwindcss.com/docs/plugins#adding-components
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Post title styles
|
||||||
|
*
|
||||||
|
* These will be applied to all headings with a `page-title` or `entry-title`
|
||||||
|
* class on the frontend and to the post title in the block editor.
|
||||||
|
*
|
||||||
|
* The supplied styles are meant to match the default `h1` classes from
|
||||||
|
* Tailwind Typography.
|
||||||
|
*/
|
||||||
|
.page-title,
|
||||||
|
.entry-title {
|
||||||
|
@apply max-w-content mx-auto mb-6 text-3xl font-extrabold text-neutral-900;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Layout styles for centered content areas
|
||||||
|
*
|
||||||
|
* If you are controlling the width of your content area with styles applied
|
||||||
|
* to its container, you can delete the following styles whose selectors begin
|
||||||
|
* with `.page-content >` and `.entry-content >`. For more details, please see
|
||||||
|
* the following:
|
||||||
|
*
|
||||||
|
* https://make.wordpress.org/core/2021/06/29/on-layout-and-content-width-in-wordpress-5-8/
|
||||||
|
*/
|
||||||
|
.page-content > *,
|
||||||
|
.entry-content > * {
|
||||||
|
/* Content width from the `theme.json` file */
|
||||||
|
@apply max-w-content mx-auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.entry-content > .alignwide {
|
||||||
|
/* Wide width from the `theme.json` file */
|
||||||
|
@apply max-w-wide;
|
||||||
|
}
|
||||||
|
|
||||||
|
.entry-content > .alignfull {
|
||||||
|
@apply max-w-none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.entry-content > .alignleft {
|
||||||
|
@apply float-left mr-8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.entry-content > .alignright {
|
||||||
|
@apply float-right ml-8;
|
||||||
|
}
|
||||||
23
tailwind/custom/file-header.css
Normal file
23
tailwind/custom/file-header.css
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*!
|
||||||
|
Theme Name: FamiliaRosaTheme
|
||||||
|
Theme URI: https://josevi.dev
|
||||||
|
Author: Josevi Canet
|
||||||
|
Author URI: https://underscoretw.com/
|
||||||
|
Description: A custom theme based on _tw
|
||||||
|
Version: 0.1.0
|
||||||
|
Tested up to: 6.2
|
||||||
|
Requires PHP: 7.4
|
||||||
|
License: GNU General Public License v2 or later
|
||||||
|
License URI: LICENSE
|
||||||
|
Text Domain: familiarosatheme
|
||||||
|
Tags:
|
||||||
|
|
||||||
|
This theme, like WordPress, is licensed under the GPL.
|
||||||
|
Use it to make something cool, have fun, and share what you've learned.
|
||||||
|
|
||||||
|
FamiliaRosaTheme is based on _tw https://underscoretw.com/, (C) 2021-2025 Greg Sullivan
|
||||||
|
_tw is distributed under the terms of the GNU GPL v2 or later.
|
||||||
|
|
||||||
|
_tw is based on Underscores https://underscores.me/ and Varia https://github.com/Automattic/themes/tree/master/varia, (C) 2012-2025 Automattic, Inc.
|
||||||
|
Underscores and Varia are distributed under the terms of the GNU GPL v2 or later.
|
||||||
|
*/
|
||||||
5
tailwind/custom/fonts.css
Normal file
5
tailwind/custom/fonts.css
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
/**
|
||||||
|
* Custom `@font-face` rules
|
||||||
|
*
|
||||||
|
* These will be added immediately before Tailwind’s `base` layer.
|
||||||
|
*/
|
||||||
8
tailwind/custom/utilities.css
Normal file
8
tailwind/custom/utilities.css
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* Custom styles to immediately follow Tailwind’s `utilities` layer
|
||||||
|
*
|
||||||
|
* Add your own utility classes to this theme. Complex utility classes should
|
||||||
|
* be added using Tailwind’s plugin system:
|
||||||
|
*
|
||||||
|
* https://tailwindcss.com/docs/adding-custom-styles#adding-custom-utilities
|
||||||
|
*/
|
||||||
21
tailwind/partials/footer.css
Normal file
21
tailwind/partials/footer.css
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* Because this code is used in both `tailwind.css` and `tailwind-editor.css`,
|
||||||
|
* we import it from here to avoid duplication.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Tailwind's component classes and any component classes registered by
|
||||||
|
* plugins, then add custom component classes.
|
||||||
|
*
|
||||||
|
* The `components.css` file is located in a subfolder to allow for additional
|
||||||
|
* components files from, e.g., vendor packages. Those files need to be
|
||||||
|
* manually added below.
|
||||||
|
*/
|
||||||
|
@import "../custom/components/components.css";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Tailwind's utility classes and any utility classes registered by
|
||||||
|
* plugins, then add custom utility classes.
|
||||||
|
*/
|
||||||
|
@import "tailwindcss/utilities";
|
||||||
|
@import "../custom/utilities.css";
|
||||||
25
tailwind/partials/header.css
Normal file
25
tailwind/partials/header.css
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* Because this code is used in both `tailwind.css` and `tailwind-editor.css`,
|
||||||
|
* we import it from here to avoid duplication.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Tailwind Typography and a corresponding config file.
|
||||||
|
*/
|
||||||
|
@plugin "@_tw/typography";
|
||||||
|
@config "../tailwind-typography.config.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the WordPress file header.
|
||||||
|
*/
|
||||||
|
@import "../custom/file-header.css";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add both the default Tailwind theme and your custom theme.
|
||||||
|
*/
|
||||||
|
@import "../tailwind-theme.css";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add custom `@font-face` rules.
|
||||||
|
*/
|
||||||
|
@import "../custom/fonts.css";
|
||||||
23
tailwind/tailwind-editor-extra.css
Normal file
23
tailwind/tailwind-editor-extra.css
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Additional styles applied only to the WordPress editor
|
||||||
|
*
|
||||||
|
* It is sometimes necessary to add additional styles for the WordPress block
|
||||||
|
* editor, generally to improve the editor experience. For example, you may
|
||||||
|
* want to tweak the appearance of the title area to better match your site’s
|
||||||
|
* front end, or you may need to change the appearance of a block to better
|
||||||
|
* distinguish between its fields while editing.
|
||||||
|
*
|
||||||
|
* Those styles should be added in this file, and they will be added only to
|
||||||
|
* the block editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This allows you to use classes from both the default Tailwind theme and
|
||||||
|
* your custom theme.
|
||||||
|
*/
|
||||||
|
@reference "./tailwind-theme.css";
|
||||||
|
|
||||||
|
.entry-header,
|
||||||
|
.entry-content {
|
||||||
|
@apply px-8;
|
||||||
|
}
|
||||||
26
tailwind/tailwind-editor.css
Normal file
26
tailwind/tailwind-editor.css
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/**
|
||||||
|
* This file outputs to `style-editor.css`, your main block editor style sheet.
|
||||||
|
*
|
||||||
|
* You probably won’t need to edit this file. You’re more likely to want to
|
||||||
|
* edit `./tailwind/tailwind-theme.css`, which contains your project’s custom
|
||||||
|
* design tokens, or files in the `./tailwind/custom` folder.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Because this file shares code with `tailwind.css`, we import the shared code
|
||||||
|
* to avoid duplication.
|
||||||
|
*/
|
||||||
|
@import "./partials/header.css";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add your custom base styles.
|
||||||
|
*/
|
||||||
|
@layer base {
|
||||||
|
@import "./custom/base.css";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Because this file shares code with `tailwind.css`, we import the shared code
|
||||||
|
* to avoid duplication.
|
||||||
|
*/
|
||||||
|
@import "./partials/footer.css";
|
||||||
36
tailwind/tailwind-theme.css
Normal file
36
tailwind/tailwind-theme.css
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/**
|
||||||
|
* Add your design tokens as Tailwind theme variables.
|
||||||
|
*
|
||||||
|
* https://tailwindcss.com/docs/theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Import Tailwind’s default theme.
|
||||||
|
*/
|
||||||
|
@import "tailwindcss/theme";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Your theme variables are merged with Tailwind’s defaults, either extending
|
||||||
|
* the default theme with new variables or overriding the values of existing
|
||||||
|
* variables.
|
||||||
|
*/
|
||||||
|
@theme {
|
||||||
|
/**
|
||||||
|
* These theme variables use CSS variables set by WordPress using values
|
||||||
|
* from your `theme.json` file.
|
||||||
|
*
|
||||||
|
* If you are using the classic editor, you may need to use hardcoded
|
||||||
|
* color values instead of the `var()` functions below.
|
||||||
|
*/
|
||||||
|
--color-background: var(--wp--preset--color--background);
|
||||||
|
--color-foreground: var(--wp--preset--color--foreground);
|
||||||
|
--color-primary: var(--wp--preset--color--primary);
|
||||||
|
--color-secondary: var(--wp--preset--color--secondary);
|
||||||
|
--color-tertiary: var(--wp--preset--color--tertiary);
|
||||||
|
--container-content: var(--wp--style--global--content-size);
|
||||||
|
--container-wide: var(--wp--style--global--wide-size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add your theme below:
|
||||||
|
*/
|
||||||
|
}
|
||||||
165
tailwind/tailwind-typography.config.js
Normal file
165
tailwind/tailwind-typography.config.js
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
/**
|
||||||
|
* Tailwind Typography can only be configured via JavaScript, using a legacy
|
||||||
|
* configuration file like this one.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Copied from Tailwind Typography.
|
||||||
|
const hexToRgb = (hex) => {
|
||||||
|
if (typeof hex !== 'string' || hex.length === 0) {
|
||||||
|
return hex;
|
||||||
|
}
|
||||||
|
|
||||||
|
hex = hex.replace('#', '');
|
||||||
|
hex = hex.length === 3 ? hex.replace(/./g, '$&$&') : hex;
|
||||||
|
const r = parseInt(hex.substring(0, 2), 16);
|
||||||
|
const g = parseInt(hex.substring(2, 4), 16);
|
||||||
|
const b = parseInt(hex.substring(4, 6), 16);
|
||||||
|
return `${r} ${g} ${b}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
typography: (theme) => ({
|
||||||
|
/**
|
||||||
|
* Tailwind Typography’s default styles are opinionated, and
|
||||||
|
* you may need to override them if you have mockups to
|
||||||
|
* replicate. You can view the default modifiers here:
|
||||||
|
*
|
||||||
|
* https://github.com/tailwindlabs/tailwindcss-typography/blob/master/src/styles.js
|
||||||
|
*/
|
||||||
|
|
||||||
|
DEFAULT: {
|
||||||
|
css: [
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* By default, max-width is set to 65 characters.
|
||||||
|
* This is a good default for readability, but
|
||||||
|
* often in conflict with client-supplied designs.
|
||||||
|
* A value of false removes the max-width property.
|
||||||
|
*/
|
||||||
|
maxWidth: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tailwind Typography uses the font weights 400
|
||||||
|
* through 900. If you’re not using a variable font,
|
||||||
|
* you may need to limit the number of supported
|
||||||
|
* weights. Below are all of the default weights,
|
||||||
|
* ready to be overridden.
|
||||||
|
*/
|
||||||
|
// a: {
|
||||||
|
// fontWeight: '500',
|
||||||
|
// },
|
||||||
|
// strong: {
|
||||||
|
// fontWeight: '600',
|
||||||
|
// },
|
||||||
|
// 'ol > li::marker': {
|
||||||
|
// fontWeight: '400',
|
||||||
|
// },
|
||||||
|
// dt: {
|
||||||
|
// fontWeight: '600',
|
||||||
|
// },
|
||||||
|
// blockquote: {
|
||||||
|
// fontWeight: '500',
|
||||||
|
// },
|
||||||
|
// h1: {
|
||||||
|
// fontWeight: '800',
|
||||||
|
// },
|
||||||
|
// 'h1 strong': {
|
||||||
|
// fontWeight: '900',
|
||||||
|
// },
|
||||||
|
// h2: {
|
||||||
|
// fontWeight: '700',
|
||||||
|
// },
|
||||||
|
// 'h2 strong': {
|
||||||
|
// fontWeight: '800',
|
||||||
|
// },
|
||||||
|
// h3: {
|
||||||
|
// fontWeight: '600',
|
||||||
|
// },
|
||||||
|
// 'h3 strong': {
|
||||||
|
// fontWeight: '700',
|
||||||
|
// },
|
||||||
|
// h4: {
|
||||||
|
// fontWeight: '600',
|
||||||
|
// },
|
||||||
|
// 'h4 strong': {
|
||||||
|
// fontWeight: '700',
|
||||||
|
// },
|
||||||
|
// kbd: {
|
||||||
|
// fontWeight: '500',
|
||||||
|
// },
|
||||||
|
// code: {
|
||||||
|
// fontWeight: '600',
|
||||||
|
// },
|
||||||
|
// pre: {
|
||||||
|
// fontWeight: '400',
|
||||||
|
// },
|
||||||
|
// 'thead th': {
|
||||||
|
// fontWeight: '600',
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* By default, _tw uses Tailwind Typography’s Neutral gray
|
||||||
|
* scale. If you are adapting an existing design and you need
|
||||||
|
* to set specific colors throughout, you can do so here. In
|
||||||
|
* your `./theme/functions.php file, you will need to replace
|
||||||
|
* `-neutral` with `-FamiliaRosaTheme`.
|
||||||
|
*/
|
||||||
|
familiarosatheme: {
|
||||||
|
css: {
|
||||||
|
'--tw-prose-body': theme('colors.foreground'),
|
||||||
|
'--tw-prose-headings': theme('colors.foreground'),
|
||||||
|
'--tw-prose-lead': theme('colors.foreground'),
|
||||||
|
'--tw-prose-links': theme('colors.primary'),
|
||||||
|
'--tw-prose-bold': theme('colors.foreground'),
|
||||||
|
'--tw-prose-counters': theme('colors.primary'),
|
||||||
|
'--tw-prose-bullets': theme('colors.primary'),
|
||||||
|
'--tw-prose-hr': theme('colors.foreground'),
|
||||||
|
'--tw-prose-quotes': theme('colors.foreground'),
|
||||||
|
'--tw-prose-quote-borders': theme('colors.primary'),
|
||||||
|
'--tw-prose-captions': theme('colors.foreground'),
|
||||||
|
'--tw-prose-kbd': theme('colors.foreground'),
|
||||||
|
'--tw-prose-kbd-shadows': hexToRgb(
|
||||||
|
theme('colors.foreground')
|
||||||
|
),
|
||||||
|
'--tw-prose-code': theme('colors.foreground'),
|
||||||
|
'--tw-prose-pre-code': theme('colors.background'),
|
||||||
|
'--tw-prose-pre-bg': theme('colors.foreground'),
|
||||||
|
'--tw-prose-th-borders': theme('colors.foreground'),
|
||||||
|
'--tw-prose-td-borders': theme('colors.foreground'),
|
||||||
|
'--tw-prose-invert-body': theme('colors.background'),
|
||||||
|
'--tw-prose-invert-headings':
|
||||||
|
theme('colors.background'),
|
||||||
|
'--tw-prose-invert-lead': theme('colors.background'),
|
||||||
|
'--tw-prose-invert-links': theme('colors.primary'),
|
||||||
|
'--tw-prose-invert-bold': theme('colors.background'),
|
||||||
|
'--tw-prose-invert-counters': theme('colors.primary'),
|
||||||
|
'--tw-prose-invert-bullets': theme('colors.primary'),
|
||||||
|
'--tw-prose-invert-hr': theme('colors.background'),
|
||||||
|
'--tw-prose-invert-quotes': theme('colors.background'),
|
||||||
|
'--tw-prose-invert-quote-borders':
|
||||||
|
theme('colors.primary'),
|
||||||
|
'--tw-prose-invert-captions':
|
||||||
|
theme('colors.background'),
|
||||||
|
'--tw-prose-invert-kbd': theme('colors.background'),
|
||||||
|
'--tw-prose-invert-kbd-shadows': hexToRgb(
|
||||||
|
theme('colors.background')
|
||||||
|
),
|
||||||
|
'--tw-prose-invert-code': theme('colors.foreground'),
|
||||||
|
'--tw-prose-invert-pre-code':
|
||||||
|
theme('colors.background'),
|
||||||
|
'--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
|
||||||
|
'--tw-prose-invert-th-borders':
|
||||||
|
theme('colors.background'),
|
||||||
|
'--tw-prose-invert-td-borders':
|
||||||
|
theme('colors.background'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
25
tailwind/tailwind.css
Normal file
25
tailwind/tailwind.css
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* This file outputs to `style.css`, your main front-end style sheet.
|
||||||
|
*
|
||||||
|
* You probably won’t need to edit this file. You’re more likely to want to
|
||||||
|
* edit `./tailwind/tailwind-theme.css`, which contains your project’s custom
|
||||||
|
* design tokens, or files in the `./tailwind/custom` folder.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Because this file shares code with `tailwind-editor.css`, we import the
|
||||||
|
* shared code to avoid duplication.
|
||||||
|
*/
|
||||||
|
@import "./partials/header.css";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Tailwind’s Preflight styles followed by your custom base styles.
|
||||||
|
*/
|
||||||
|
@import "tailwindcss/preflight";
|
||||||
|
@import "./custom/base.css";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Because this file shares code with `tailwind-editor.css`, we import the
|
||||||
|
* shared code to avoid duplication.
|
||||||
|
*/
|
||||||
|
@import "./partials/footer.css";
|
||||||
31
theme/404.php
Normal file
31
theme/404.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The template for displaying 404 pages (not found)
|
||||||
|
*
|
||||||
|
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section id="primary">
|
||||||
|
<main id="main">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<header class="page-header">
|
||||||
|
<h1 class="page-title"><?php esc_html_e( 'Page Not Found', 'familiarosatheme' ); ?></h1>
|
||||||
|
</header><!-- .page-header -->
|
||||||
|
|
||||||
|
<div <?php familiarosatheme_content_class( 'page-content' ); ?>>
|
||||||
|
<p><?php esc_html_e( 'This page could not be found. It might have been removed or renamed, or it may never have existed.', 'familiarosatheme' ); ?></p>
|
||||||
|
<?php get_search_form(); ?>
|
||||||
|
</div><!-- .page-content -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main><!-- #main -->
|
||||||
|
</section><!-- #primary -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_footer();
|
||||||
45
theme/archive.php
Normal file
45
theme/archive.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The template for displaying archive pages
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section id="primary">
|
||||||
|
<main id="main">
|
||||||
|
|
||||||
|
<?php if ( have_posts() ) : ?>
|
||||||
|
|
||||||
|
<header class="page-header">
|
||||||
|
<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
|
||||||
|
</header><!-- .page-header -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Start the Loop.
|
||||||
|
while ( have_posts() ) :
|
||||||
|
the_post();
|
||||||
|
get_template_part( 'template-parts/content/content', 'excerpt' );
|
||||||
|
|
||||||
|
// End the loop.
|
||||||
|
endwhile;
|
||||||
|
|
||||||
|
// Previous/next page navigation.
|
||||||
|
familiarosatheme_the_posts_navigation();
|
||||||
|
|
||||||
|
else :
|
||||||
|
|
||||||
|
// If no content, include the "No posts found" template.
|
||||||
|
get_template_part( 'template-parts/content/content', 'none' );
|
||||||
|
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</main><!-- #main -->
|
||||||
|
</section><!-- #primary -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_footer();
|
||||||
81
theme/comments.php
Normal file
81
theme/comments.php
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The template for displaying comments
|
||||||
|
*
|
||||||
|
* This is the template that displays the area of the page that contains both
|
||||||
|
* the current comments and the comment form.
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the current post is protected by a password and the visitor has not yet
|
||||||
|
* entered the password we will return early without loading the comments.
|
||||||
|
*/
|
||||||
|
if ( post_password_required() ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="comments">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( have_comments() ) :
|
||||||
|
?>
|
||||||
|
<h2>
|
||||||
|
<?php
|
||||||
|
$familiarosatheme_comment_count = get_comments_number();
|
||||||
|
if ( '1' === $familiarosatheme_comment_count ) {
|
||||||
|
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
printf(
|
||||||
|
/* translators: 1: title. */
|
||||||
|
esc_html__( 'One comment on “%1$s”', 'familiarosatheme' ),
|
||||||
|
get_the_title()
|
||||||
|
);
|
||||||
|
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
} else {
|
||||||
|
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
printf(
|
||||||
|
/* translators: 1: comment count number, 2: title. */
|
||||||
|
esc_html( _nx( '%1$s comment on “%2$s”', '%1$s comments on “%2$s”', $familiarosatheme_comment_count, 'comments title', 'familiarosatheme' ) ),
|
||||||
|
number_format_i18n( $familiarosatheme_comment_count ),
|
||||||
|
get_the_title()
|
||||||
|
);
|
||||||
|
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<?php the_comments_navigation(); ?>
|
||||||
|
|
||||||
|
<ol>
|
||||||
|
<?php
|
||||||
|
wp_list_comments(
|
||||||
|
array(
|
||||||
|
'style' => 'ol',
|
||||||
|
'callback' => 'familiarosatheme_html5_comment',
|
||||||
|
'short_ping' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
the_comments_navigation();
|
||||||
|
|
||||||
|
// If there are existing comments, but comments are closed, display a
|
||||||
|
// message.
|
||||||
|
if ( ! comments_open() ) :
|
||||||
|
?>
|
||||||
|
<p><?php esc_html_e( 'Comments are closed.', 'familiarosatheme' ); ?></p>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
comment_form();
|
||||||
|
?>
|
||||||
|
|
||||||
|
</div><!-- #comments -->
|
||||||
23
theme/footer.php
Normal file
23
theme/footer.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The template for displaying the footer
|
||||||
|
*
|
||||||
|
* Contains the closing of the `#content` element and all content thereafter.
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
</div><!-- #content -->
|
||||||
|
|
||||||
|
<?php get_template_part( 'template-parts/layout/footer', 'content' ); ?>
|
||||||
|
|
||||||
|
</div><!-- #page -->
|
||||||
|
|
||||||
|
<?php wp_footer(); ?>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
197
theme/functions.php
Normal file
197
theme/functions.php
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* FamiliaRosaTheme functions and definitions
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/theme-functions/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( ! defined( 'FAMILIAROSATHEME_VERSION' ) ) {
|
||||||
|
/*
|
||||||
|
* Set the theme’s version number.
|
||||||
|
*
|
||||||
|
* This is used primarily for cache busting. If you use `npm run bundle`
|
||||||
|
* to create your production build, the value below will be replaced in the
|
||||||
|
* generated zip file with a timestamp, converted to base 36.
|
||||||
|
*/
|
||||||
|
define( 'FAMILIAROSATHEME_VERSION', '0.1.0' );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! defined( 'FAMILIAROSATHEME_TYPOGRAPHY_CLASSES' ) ) {
|
||||||
|
/*
|
||||||
|
* Set Tailwind Typography classes for the front end, block editor and
|
||||||
|
* classic editor using the constant below.
|
||||||
|
*
|
||||||
|
* For the front end, these classes are added by the `familiarosatheme_content_class`
|
||||||
|
* function. You will see that function used everywhere an `entry-content`
|
||||||
|
* or `page-content` class has been added to a wrapper element.
|
||||||
|
*
|
||||||
|
* For the block editor, these classes are converted to a JavaScript array
|
||||||
|
* and then used by the `./javascript/block-editor.js` file, which adds
|
||||||
|
* them to the appropriate elements in the block editor (and adds them
|
||||||
|
* again when they’re removed.)
|
||||||
|
*
|
||||||
|
* For the classic editor (and anything using TinyMCE, like Advanced Custom
|
||||||
|
* Fields), these classes are added to TinyMCE’s body class when it
|
||||||
|
* initializes.
|
||||||
|
*/
|
||||||
|
define(
|
||||||
|
'FAMILIAROSATHEME_TYPOGRAPHY_CLASSES',
|
||||||
|
'prose prose-neutral max-w-none prose-a:text-primary'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_setup' ) ) :
|
||||||
|
/**
|
||||||
|
* Sets up theme defaults and registers support for various WordPress features.
|
||||||
|
*
|
||||||
|
* Note that this function is hooked into the after_setup_theme hook, which
|
||||||
|
* runs before the init hook. The init hook is too late for some features, such
|
||||||
|
* as indicating support for post thumbnails.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_setup() {
|
||||||
|
/*
|
||||||
|
* Make theme available for translation.
|
||||||
|
* Translations can be filed in the /languages/ directory.
|
||||||
|
* If you're building a theme based on FamiliaRosaTheme, use a find and replace
|
||||||
|
* to change 'familiarosatheme' to the name of your theme in all the template files.
|
||||||
|
*/
|
||||||
|
load_theme_textdomain( 'familiarosatheme', get_template_directory() . '/languages' );
|
||||||
|
|
||||||
|
// Add default posts and comments RSS feed links to head.
|
||||||
|
add_theme_support( 'automatic-feed-links' );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Let WordPress manage the document title.
|
||||||
|
* By adding theme support, we declare that this theme does not use a
|
||||||
|
* hard-coded <title> tag in the document head, and expect WordPress to
|
||||||
|
* provide it for us.
|
||||||
|
*/
|
||||||
|
add_theme_support( 'title-tag' );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Enable support for Post Thumbnails on posts and pages.
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
|
||||||
|
*/
|
||||||
|
add_theme_support( 'post-thumbnails' );
|
||||||
|
|
||||||
|
// This theme uses wp_nav_menu() in two locations.
|
||||||
|
register_nav_menus(
|
||||||
|
array(
|
||||||
|
'menu-1' => __( 'Primary', 'familiarosatheme' ),
|
||||||
|
'menu-2' => __( 'Footer Menu', 'familiarosatheme' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Switch default core markup for search form, comment form, and comments
|
||||||
|
* to output valid HTML5.
|
||||||
|
*/
|
||||||
|
add_theme_support(
|
||||||
|
'html5',
|
||||||
|
array(
|
||||||
|
'search-form',
|
||||||
|
'comment-form',
|
||||||
|
'comment-list',
|
||||||
|
'gallery',
|
||||||
|
'caption',
|
||||||
|
'style',
|
||||||
|
'script',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add theme support for selective refresh for widgets.
|
||||||
|
add_theme_support( 'customize-selective-refresh-widgets' );
|
||||||
|
|
||||||
|
// Add support for editor styles.
|
||||||
|
add_theme_support( 'editor-styles' );
|
||||||
|
|
||||||
|
// Enqueue editor styles.
|
||||||
|
add_editor_style( 'style-editor.css' );
|
||||||
|
add_editor_style( 'style-editor-extra.css' );
|
||||||
|
|
||||||
|
// Add support for responsive embedded content.
|
||||||
|
add_theme_support( 'responsive-embeds' );
|
||||||
|
|
||||||
|
// Remove support for block templates.
|
||||||
|
remove_theme_support( 'block-templates' );
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
add_action( 'after_setup_theme', 'familiarosatheme_setup' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register widget area.
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
|
||||||
|
*/
|
||||||
|
function familiarosatheme_widgets_init() {
|
||||||
|
register_sidebar(
|
||||||
|
array(
|
||||||
|
'name' => __( 'Footer', 'familiarosatheme' ),
|
||||||
|
'id' => 'sidebar-1',
|
||||||
|
'description' => __( 'Add widgets here to appear in your footer.', 'familiarosatheme' ),
|
||||||
|
'before_widget' => '<section id="%1$s" class="widget %2$s">',
|
||||||
|
'after_widget' => '</section>',
|
||||||
|
'before_title' => '<h2 class="widget-title">',
|
||||||
|
'after_title' => '</h2>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
add_action( 'widgets_init', 'familiarosatheme_widgets_init' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enqueue scripts and styles.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_scripts() {
|
||||||
|
wp_enqueue_style( 'familiarosatheme-style', get_stylesheet_uri(), array(), FAMILIAROSATHEME_VERSION );
|
||||||
|
wp_enqueue_script( 'familiarosatheme-script', get_template_directory_uri() . '/js/script.min.js', array(), FAMILIAROSATHEME_VERSION, true );
|
||||||
|
|
||||||
|
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||||
|
wp_enqueue_script( 'comment-reply' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action( 'wp_enqueue_scripts', 'familiarosatheme_scripts' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enqueue the block editor script.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_enqueue_block_editor_script() {
|
||||||
|
if ( is_admin() ) {
|
||||||
|
wp_enqueue_script(
|
||||||
|
'familiarosatheme-editor',
|
||||||
|
get_template_directory_uri() . '/js/block-editor.min.js',
|
||||||
|
array(
|
||||||
|
'wp-blocks',
|
||||||
|
'wp-edit-post',
|
||||||
|
),
|
||||||
|
FAMILIAROSATHEME_VERSION,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
wp_add_inline_script( 'familiarosatheme-editor', "tailwindTypographyClasses = '" . esc_attr( FAMILIAROSATHEME_TYPOGRAPHY_CLASSES ) . "'.split(' ');", 'before' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action( 'enqueue_block_assets', 'familiarosatheme_enqueue_block_editor_script' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the Tailwind Typography classes to TinyMCE.
|
||||||
|
*
|
||||||
|
* @param array $settings TinyMCE settings.
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function familiarosatheme_tinymce_add_class( $settings ) {
|
||||||
|
$settings['body_class'] = FAMILIAROSATHEME_TYPOGRAPHY_CLASSES;
|
||||||
|
return $settings;
|
||||||
|
}
|
||||||
|
add_filter( 'tiny_mce_before_init', 'familiarosatheme_tinymce_add_class' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom template tags for this theme.
|
||||||
|
*/
|
||||||
|
require get_template_directory() . '/inc/template-tags.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Functions which enhance the theme by hooking into WordPress.
|
||||||
|
*/
|
||||||
|
require get_template_directory() . '/inc/template-functions.php';
|
||||||
31
theme/header.php
Normal file
31
theme/header.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The header for our theme
|
||||||
|
*
|
||||||
|
* This is the template that displays the `head` element and everything up
|
||||||
|
* until the `#content` element.
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
?><!doctype html>
|
||||||
|
<html <?php language_attributes(); ?>>
|
||||||
|
<head>
|
||||||
|
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="profile" href="https://gmpg.org/xfn/11">
|
||||||
|
<?php wp_head(); ?>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body <?php body_class(); ?>>
|
||||||
|
|
||||||
|
<?php wp_body_open(); ?>
|
||||||
|
|
||||||
|
<div id="page">
|
||||||
|
<a href="#content" class="sr-only"><?php esc_html_e( 'Skip to content', 'familiarosatheme' ); ?></a>
|
||||||
|
|
||||||
|
<?php get_template_part( 'template-parts/layout/header', 'content' ); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
206
theme/inc/template-functions.php
Normal file
206
theme/inc/template-functions.php
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Functions which enhance the theme by hooking into WordPress
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a pingback url auto-discovery header for single posts, pages, or attachments.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_pingback_header() {
|
||||||
|
if ( is_singular() && pings_open() ) {
|
||||||
|
printf( '<link rel="pingback" href="%s">', esc_url( get_bloginfo( 'pingback_url' ) ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action( 'wp_head', 'familiarosatheme_pingback_header' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes comment form default fields.
|
||||||
|
*
|
||||||
|
* @param array $defaults The default comment form arguments.
|
||||||
|
*
|
||||||
|
* @return array Returns the modified fields.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_comment_form_defaults( $defaults ) {
|
||||||
|
$comment_field = $defaults['comment_field'];
|
||||||
|
|
||||||
|
// Adjust height of comment form.
|
||||||
|
$defaults['comment_field'] = preg_replace( '/rows="\d+"/', 'rows="5"', $comment_field );
|
||||||
|
|
||||||
|
return $defaults;
|
||||||
|
}
|
||||||
|
add_filter( 'comment_form_defaults', 'familiarosatheme_comment_form_defaults' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters the default archive titles.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_get_the_archive_title() {
|
||||||
|
if ( is_category() ) {
|
||||||
|
$title = __( 'Category Archives: ', 'familiarosatheme' ) . '<span>' . single_term_title( '', false ) . '</span>';
|
||||||
|
} elseif ( is_tag() ) {
|
||||||
|
$title = __( 'Tag Archives: ', 'familiarosatheme' ) . '<span>' . single_term_title( '', false ) . '</span>';
|
||||||
|
} elseif ( is_author() ) {
|
||||||
|
$title = __( 'Author Archives: ', 'familiarosatheme' ) . '<span>' . get_the_author_meta( 'display_name' ) . '</span>';
|
||||||
|
} elseif ( is_year() ) {
|
||||||
|
$title = __( 'Yearly Archives: ', 'familiarosatheme' ) . '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'familiarosatheme' ) ) . '</span>';
|
||||||
|
} elseif ( is_month() ) {
|
||||||
|
$title = __( 'Monthly Archives: ', 'familiarosatheme' ) . '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'familiarosatheme' ) ) . '</span>';
|
||||||
|
} elseif ( is_day() ) {
|
||||||
|
$title = __( 'Daily Archives: ', 'familiarosatheme' ) . '<span>' . get_the_date() . '</span>';
|
||||||
|
} elseif ( is_post_type_archive() ) {
|
||||||
|
$cpt = get_post_type_object( get_queried_object()->name );
|
||||||
|
$title = sprintf(
|
||||||
|
/* translators: %s: Post type singular name */
|
||||||
|
esc_html__( '%s Archives', 'familiarosatheme' ),
|
||||||
|
$cpt->labels->singular_name
|
||||||
|
);
|
||||||
|
} elseif ( is_tax() ) {
|
||||||
|
$tax = get_taxonomy( get_queried_object()->taxonomy );
|
||||||
|
$title = sprintf(
|
||||||
|
/* translators: %s: Taxonomy singular name */
|
||||||
|
esc_html__( '%s Archives', 'familiarosatheme' ),
|
||||||
|
$tax->labels->singular_name
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$title = __( 'Archives:', 'familiarosatheme' );
|
||||||
|
}
|
||||||
|
return $title;
|
||||||
|
}
|
||||||
|
add_filter( 'get_the_archive_title', 'familiarosatheme_get_the_archive_title' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines whether the post thumbnail can be displayed.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_can_show_post_thumbnail() {
|
||||||
|
return apply_filters( 'familiarosatheme_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the size for avatars used in the theme.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_get_avatar_size() {
|
||||||
|
return 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the continue reading link
|
||||||
|
*
|
||||||
|
* @param string $more_string The string shown within the more link.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_continue_reading_link( $more_string ) {
|
||||||
|
|
||||||
|
if ( ! is_admin() ) {
|
||||||
|
$continue_reading = sprintf(
|
||||||
|
/* translators: %s: Name of current post. */
|
||||||
|
wp_kses( __( 'Continue reading %s', 'familiarosatheme' ), array( 'span' => array( 'class' => array() ) ) ),
|
||||||
|
the_title( '<span class="sr-only">"', '"</span>', false )
|
||||||
|
);
|
||||||
|
|
||||||
|
$more_string = '<a href="' . esc_url( get_permalink() ) . '">' . $continue_reading . '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $more_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter the excerpt more link.
|
||||||
|
add_filter( 'excerpt_more', 'familiarosatheme_continue_reading_link' );
|
||||||
|
|
||||||
|
// Filter the content more link.
|
||||||
|
add_filter( 'the_content_more_link', 'familiarosatheme_continue_reading_link' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Outputs a comment in the HTML5 format.
|
||||||
|
*
|
||||||
|
* This function overrides the default WordPress comment output in HTML5
|
||||||
|
* format, adding the required class for Tailwind Typography. Based on the
|
||||||
|
* `html5_comment()` function from WordPress core.
|
||||||
|
*
|
||||||
|
* @param WP_Comment $comment Comment to display.
|
||||||
|
* @param array $args An array of arguments.
|
||||||
|
* @param int $depth Depth of the current comment.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_html5_comment( $comment, $args, $depth ) {
|
||||||
|
$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
|
||||||
|
|
||||||
|
$commenter = wp_get_current_commenter();
|
||||||
|
$show_pending_links = ! empty( $commenter['comment_author'] );
|
||||||
|
|
||||||
|
if ( $commenter['comment_author_email'] ) {
|
||||||
|
$moderation_note = __( 'Your comment is awaiting moderation.', 'familiarosatheme' );
|
||||||
|
} else {
|
||||||
|
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.', 'familiarosatheme' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<<?php echo esc_attr( $tag ); ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $comment->has_children ? 'parent' : '', $comment ); ?>>
|
||||||
|
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
|
||||||
|
<footer class="comment-meta">
|
||||||
|
<div class="comment-author vcard">
|
||||||
|
<?php
|
||||||
|
if ( 0 !== $args['avatar_size'] ) {
|
||||||
|
echo get_avatar( $comment, $args['avatar_size'] );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
$comment_author = get_comment_author_link( $comment );
|
||||||
|
|
||||||
|
if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
|
||||||
|
$comment_author = get_comment_author( $comment );
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(
|
||||||
|
/* translators: %s: Comment author link. */
|
||||||
|
wp_kses_post( __( '%s <span class="says">says:</span>', 'familiarosatheme' ) ),
|
||||||
|
sprintf( '<b class="fn">%s</b>', wp_kses_post( $comment_author ) )
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div><!-- .comment-author -->
|
||||||
|
|
||||||
|
<div class="comment-metadata">
|
||||||
|
<?php
|
||||||
|
printf(
|
||||||
|
'<a href="%s"><time datetime="%s">%s</time></a>',
|
||||||
|
esc_url( get_comment_link( $comment, $args ) ),
|
||||||
|
esc_attr( get_comment_time( 'c' ) ),
|
||||||
|
esc_html(
|
||||||
|
sprintf(
|
||||||
|
/* translators: 1: Comment date, 2: Comment time. */
|
||||||
|
__( '%1$s at %2$s', 'familiarosatheme' ),
|
||||||
|
get_comment_date( '', $comment ),
|
||||||
|
get_comment_time()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
edit_comment_link( __( 'Edit', 'familiarosatheme' ), ' <span class="edit-link">', '</span>' );
|
||||||
|
?>
|
||||||
|
</div><!-- .comment-metadata -->
|
||||||
|
|
||||||
|
<?php if ( '0' === $comment->comment_approved ) : ?>
|
||||||
|
<em class="comment-awaiting-moderation"><?php echo esc_html( $moderation_note ); ?></em>
|
||||||
|
<?php endif; ?>
|
||||||
|
</footer><!-- .comment-meta -->
|
||||||
|
|
||||||
|
<div <?php familiarosatheme_content_class( 'comment-content' ); ?>>
|
||||||
|
<?php comment_text(); ?>
|
||||||
|
</div><!-- .comment-content -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( '1' === $comment->comment_approved || $show_pending_links ) {
|
||||||
|
comment_reply_link(
|
||||||
|
array_merge(
|
||||||
|
$args,
|
||||||
|
array(
|
||||||
|
'add_below' => 'div-comment',
|
||||||
|
'depth' => $depth,
|
||||||
|
'max_depth' => $args['max_depth'],
|
||||||
|
'before' => '<div class="reply">',
|
||||||
|
'after' => '</div>',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</article><!-- .comment-body -->
|
||||||
|
<?php
|
||||||
|
}
|
||||||
306
theme/inc/template-tags.php
Normal file
306
theme/inc/template-tags.php
Normal file
@@ -0,0 +1,306 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Custom template tags for this theme
|
||||||
|
*
|
||||||
|
* Eventually, some functionality here could be replaced by core features.
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_posted_on' ) ) :
|
||||||
|
/**
|
||||||
|
* Prints HTML with meta information for the current post-date/time.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_posted_on() {
|
||||||
|
$time_string = '<time datetime="%1$s">%2$s</time>';
|
||||||
|
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||||
|
$time_string = '<time datetime="%1$s">%2$s</time><time datetime="%3$s">%4$s</time>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$time_string = sprintf(
|
||||||
|
$time_string,
|
||||||
|
esc_attr( get_the_date( DATE_W3C ) ),
|
||||||
|
esc_html( get_the_date() ),
|
||||||
|
esc_attr( get_the_modified_date( DATE_W3C ) ),
|
||||||
|
esc_html( get_the_modified_date() )
|
||||||
|
);
|
||||||
|
|
||||||
|
printf(
|
||||||
|
'<a href="%1$s" rel="bookmark">%2$s</a>',
|
||||||
|
esc_url( get_permalink() ),
|
||||||
|
$time_string // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
);
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_posted_by' ) ) :
|
||||||
|
/**
|
||||||
|
* Prints HTML with meta information about theme author.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_posted_by() {
|
||||||
|
printf(
|
||||||
|
/* translators: 1: posted by label, only visible to screen readers. 2: author link. 3: post author. */
|
||||||
|
'<span class="sr-only">%1$s</span><span class="author vcard"><a class="url fn n" href="%2$s">%3$s</a></span>',
|
||||||
|
esc_html__( 'Posted by', 'familiarosatheme' ),
|
||||||
|
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
||||||
|
esc_html( get_the_author() )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_comment_count' ) ) :
|
||||||
|
/**
|
||||||
|
* Prints HTML with the comment count for the current post.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_comment_count() {
|
||||||
|
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
|
||||||
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
||||||
|
comments_popup_link( sprintf( __( 'Leave a comment<span class="sr-only"> on %s</span>', 'familiarosatheme' ), get_the_title() ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_entry_meta' ) ) :
|
||||||
|
/**
|
||||||
|
* Prints HTML with meta information for the categories, tags and comments.
|
||||||
|
* This template tag is used in the entry header.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_entry_meta() {
|
||||||
|
|
||||||
|
// Hide author, post date, category and tag text for pages.
|
||||||
|
if ( 'post' === get_post_type() ) {
|
||||||
|
|
||||||
|
// Posted by.
|
||||||
|
familiarosatheme_posted_by();
|
||||||
|
|
||||||
|
// Posted on.
|
||||||
|
familiarosatheme_posted_on();
|
||||||
|
|
||||||
|
/* translators: used between list items, there is a space after the comma. */
|
||||||
|
$categories_list = get_the_category_list( __( ', ', 'familiarosatheme' ) );
|
||||||
|
if ( $categories_list ) {
|
||||||
|
printf(
|
||||||
|
/* translators: 1: posted in label, only visible to screen readers. 2: list of categories. */
|
||||||
|
'<span class="sr-only">%1$s</span>%2$s',
|
||||||
|
esc_html__( 'Posted in', 'familiarosatheme' ),
|
||||||
|
$categories_list // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* translators: used between list items, there is a space after the comma. */
|
||||||
|
$tags_list = get_the_tag_list( '', __( ', ', 'familiarosatheme' ) );
|
||||||
|
if ( $tags_list ) {
|
||||||
|
printf(
|
||||||
|
/* translators: 1: tags label, only visible to screen readers. 2: list of tags. */
|
||||||
|
'<span class="sr-only">%1$s</span>%2$s',
|
||||||
|
esc_html__( 'Tags:', 'familiarosatheme' ),
|
||||||
|
$tags_list // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Comment count.
|
||||||
|
if ( ! is_singular() ) {
|
||||||
|
familiarosatheme_comment_count();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit post link.
|
||||||
|
edit_post_link(
|
||||||
|
sprintf(
|
||||||
|
wp_kses(
|
||||||
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
||||||
|
__( 'Edit <span class="sr-only">%s</span>', 'familiarosatheme' ),
|
||||||
|
array(
|
||||||
|
'span' => array(
|
||||||
|
'class' => array(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
get_the_title()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_entry_footer' ) ) :
|
||||||
|
/**
|
||||||
|
* Prints HTML with meta information for the categories, tags and comments.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_entry_footer() {
|
||||||
|
|
||||||
|
// Hide author, post date, category and tag text for pages.
|
||||||
|
if ( 'post' === get_post_type() ) {
|
||||||
|
|
||||||
|
// Posted by.
|
||||||
|
familiarosatheme_posted_by();
|
||||||
|
|
||||||
|
// Posted on.
|
||||||
|
familiarosatheme_posted_on();
|
||||||
|
|
||||||
|
/* translators: used between list items, there is a space after the comma. */
|
||||||
|
$categories_list = get_the_category_list( __( ', ', 'familiarosatheme' ) );
|
||||||
|
if ( $categories_list ) {
|
||||||
|
printf(
|
||||||
|
/* translators: 1: posted in label, only visible to screen readers. 2: list of categories. */
|
||||||
|
'<span class="sr-only">%1$s</span>%2$s',
|
||||||
|
esc_html__( 'Posted in', 'familiarosatheme' ),
|
||||||
|
$categories_list // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* translators: used between list items, there is a space after the comma. */
|
||||||
|
$tags_list = get_the_tag_list( '', __( ', ', 'familiarosatheme' ) );
|
||||||
|
if ( $tags_list ) {
|
||||||
|
printf(
|
||||||
|
/* translators: 1: tags label, only visible to screen readers. 2: list of tags. */
|
||||||
|
'<span class="sr-only">%1$s</span>%2$s',
|
||||||
|
esc_html__( 'Tags:', 'familiarosatheme' ),
|
||||||
|
$tags_list // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Comment count.
|
||||||
|
if ( ! is_singular() ) {
|
||||||
|
familiarosatheme_comment_count();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit post link.
|
||||||
|
edit_post_link(
|
||||||
|
sprintf(
|
||||||
|
wp_kses(
|
||||||
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
||||||
|
__( 'Edit <span class="sr-only">%s</span>', 'familiarosatheme' ),
|
||||||
|
array(
|
||||||
|
'span' => array(
|
||||||
|
'class' => array(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
get_the_title()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_post_thumbnail' ) ) :
|
||||||
|
/**
|
||||||
|
* Displays an optional post thumbnail, wrapping the post thumbnail in an
|
||||||
|
* anchor element except when viewing a single post.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_post_thumbnail() {
|
||||||
|
if ( ! familiarosatheme_can_show_post_thumbnail() ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( is_singular() ) :
|
||||||
|
?>
|
||||||
|
|
||||||
|
<figure>
|
||||||
|
<?php the_post_thumbnail(); ?>
|
||||||
|
</figure><!-- .post-thumbnail -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
else :
|
||||||
|
?>
|
||||||
|
|
||||||
|
<figure>
|
||||||
|
<a href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
|
||||||
|
<?php the_post_thumbnail(); ?>
|
||||||
|
</a>
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
endif; // End is_singular().
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_comment_avatar' ) ) :
|
||||||
|
/**
|
||||||
|
* Returns the HTML markup to generate a user avatar.
|
||||||
|
*
|
||||||
|
* @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
|
||||||
|
* user email, WP_User object, WP_Post object, or WP_Comment object.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_get_user_avatar_markup( $id_or_email = null ) {
|
||||||
|
|
||||||
|
if ( ! isset( $id_or_email ) ) {
|
||||||
|
$id_or_email = get_current_user_id();
|
||||||
|
}
|
||||||
|
|
||||||
|
return sprintf( '<div class="vcard">%s</div>', get_avatar( $id_or_email, familiarosatheme_get_avatar_size() ) );
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_discussion_avatars_list' ) ) :
|
||||||
|
/**
|
||||||
|
* Displays a list of avatars involved in a discussion for a given post.
|
||||||
|
*
|
||||||
|
* @param array $comment_authors Comment authors to list as avatars.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_discussion_avatars_list( $comment_authors ) {
|
||||||
|
if ( empty( $comment_authors ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
echo '<ol>', "\n";
|
||||||
|
foreach ( $comment_authors as $id_or_email ) {
|
||||||
|
printf(
|
||||||
|
"<li>%s</li>\n",
|
||||||
|
familiarosatheme_get_user_avatar_markup( $id_or_email ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
);
|
||||||
|
}
|
||||||
|
echo '</ol>', "\n";
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_the_posts_navigation' ) ) :
|
||||||
|
/**
|
||||||
|
* Wraps `the_posts_pagination` for use throughout the theme.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_the_posts_navigation() {
|
||||||
|
the_posts_pagination(
|
||||||
|
array(
|
||||||
|
'mid_size' => 2,
|
||||||
|
'prev_text' => __( 'Newer posts', 'familiarosatheme' ),
|
||||||
|
'next_text' => __( 'Older posts', 'familiarosatheme' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! function_exists( 'familiarosatheme_content_class' ) ) :
|
||||||
|
/**
|
||||||
|
* Displays the class names for the post content wrapper.
|
||||||
|
*
|
||||||
|
* This allows us to add Tailwind Typography’s modifier classes throughout
|
||||||
|
* the theme without repeating them in multiple files. (They can be edited
|
||||||
|
* at the top of the `../functions.php` file via the
|
||||||
|
* FAMILIAROSATHEME_TYPOGRAPHY_CLASSES constant.)
|
||||||
|
*
|
||||||
|
* Based on WordPress core’s `body_class` and `get_body_class` functions.
|
||||||
|
*
|
||||||
|
* @param string|string[] $classes Space-separated string or array of class
|
||||||
|
* names to add to the class list.
|
||||||
|
*/
|
||||||
|
function familiarosatheme_content_class( $classes = '' ) {
|
||||||
|
$all_classes = array( $classes, FAMILIAROSATHEME_TYPOGRAPHY_CLASSES );
|
||||||
|
|
||||||
|
foreach ( $all_classes as &$class_groups ) {
|
||||||
|
if ( ! empty( $class_groups ) ) {
|
||||||
|
if ( ! is_array( $class_groups ) ) {
|
||||||
|
$class_groups = preg_split( '#\s+#', $class_groups );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Ensure that we always coerce class to being an array.
|
||||||
|
$class_groups = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$combined_classes = array_merge( $all_classes[0], $all_classes[1] );
|
||||||
|
$combined_classes = array_map( 'esc_attr', $combined_classes );
|
||||||
|
|
||||||
|
// Separates class names with a single space, preparing them for the
|
||||||
|
// post content wrapper.
|
||||||
|
echo 'class="' . esc_attr( implode( ' ', $combined_classes ) ) . '"';
|
||||||
|
}
|
||||||
|
endif;
|
||||||
53
theme/index.php
Normal file
53
theme/index.php
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The main template file
|
||||||
|
*
|
||||||
|
* This is the most generic template file in a WordPress theme
|
||||||
|
* and one of the two required files for a theme (the other being style.css).
|
||||||
|
* It is used to display a page when nothing more specific matches a query.
|
||||||
|
* E.g., it puts together the home page when no `home.php` file exists.
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section id="primary">
|
||||||
|
<main id="main">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( have_posts() ) {
|
||||||
|
|
||||||
|
if ( is_home() && ! is_front_page() ) :
|
||||||
|
?>
|
||||||
|
<header class="entry-header">
|
||||||
|
<h1 class="entry-title"><?php single_post_title(); ?></h1>
|
||||||
|
</header><!-- .entry-header -->
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Load posts loop.
|
||||||
|
while ( have_posts() ) {
|
||||||
|
the_post();
|
||||||
|
get_template_part( 'template-parts/content/content' );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Previous/next page navigation.
|
||||||
|
familiarosatheme_the_posts_navigation();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// If no content, include the "No posts found" template.
|
||||||
|
get_template_part( 'template-parts/content/content', 'none' );
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</main><!-- #main -->
|
||||||
|
</section><!-- #primary -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_footer();
|
||||||
11
theme/js/readme.txt
Normal file
11
theme/js/readme.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
The two JavaScript files at `../../javascript` will be processed by esbuild,
|
||||||
|
and the output files will be created in this folder with `.min.js` extensions.
|
||||||
|
The files `script.min.js` and `block-editor.min.js` are enqueued by default in
|
||||||
|
`../functions.php`.
|
||||||
|
|
||||||
|
If you would like to add new files to be processed by esbuild, add them to the
|
||||||
|
`../../javascript` folder and then add them to the `development:esbuild` key in
|
||||||
|
your `package.json` file.
|
||||||
|
|
||||||
|
DO NOT directly edit `*.min.js` files, as these files are ignored by git and
|
||||||
|
will be overwritten the next time esbuild runs.
|
||||||
7
theme/languages/readme.txt
Normal file
7
theme/languages/readme.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
Place your theme’s language files in this directory.
|
||||||
|
|
||||||
|
Please visit the following links to learn more about translating WordPress themes:
|
||||||
|
|
||||||
|
https://make.wordpress.org/polyglots/teams/
|
||||||
|
https://developer.wordpress.org/themes/functionality/localization/
|
||||||
|
https://developer.wordpress.org/reference/functions/load_theme_textdomain/
|
||||||
40
theme/page.php
Normal file
40
theme/page.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The template for displaying all pages
|
||||||
|
*
|
||||||
|
* This is the template that displays all pages by default. Please note that
|
||||||
|
* this is the WordPress construct of pages: specifically, posts with a post
|
||||||
|
* type of `page`.
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section id="primary">
|
||||||
|
<main id="main">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/* Start the Loop */
|
||||||
|
while ( have_posts() ) :
|
||||||
|
the_post();
|
||||||
|
|
||||||
|
get_template_part( 'template-parts/content/content', 'page' );
|
||||||
|
|
||||||
|
// If comments are open, or we have at least one comment, load
|
||||||
|
// the comment template.
|
||||||
|
if ( comments_open() || get_comments_number() ) {
|
||||||
|
comments_template();
|
||||||
|
}
|
||||||
|
|
||||||
|
endwhile; // End of the loop.
|
||||||
|
?>
|
||||||
|
|
||||||
|
</main><!-- #main -->
|
||||||
|
</section><!-- #primary -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_footer();
|
||||||
BIN
theme/screenshot.png
Normal file
BIN
theme/screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 264 B |
52
theme/search.php
Normal file
52
theme/search.php
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The template for displaying search results pages
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section id="primary">
|
||||||
|
<main id="main">
|
||||||
|
|
||||||
|
<?php if ( have_posts() ) : ?>
|
||||||
|
|
||||||
|
<header class="page-header">
|
||||||
|
<?php
|
||||||
|
printf(
|
||||||
|
/* translators: 1: search result title. 2: search term. */
|
||||||
|
'<h1 class="page-title">%1$s <span>%2$s</span></h1>',
|
||||||
|
esc_html__( 'Search results for:', 'familiarosatheme' ),
|
||||||
|
get_search_query()
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</header><!-- .page-header -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Start the Loop.
|
||||||
|
while ( have_posts() ) :
|
||||||
|
the_post();
|
||||||
|
get_template_part( 'template-parts/content/content', 'excerpt' );
|
||||||
|
|
||||||
|
// End the loop.
|
||||||
|
endwhile;
|
||||||
|
|
||||||
|
// Previous/next page navigation.
|
||||||
|
familiarosatheme_the_posts_navigation();
|
||||||
|
|
||||||
|
else :
|
||||||
|
|
||||||
|
// If no content is found, get the `content-none` template part.
|
||||||
|
get_template_part( 'template-parts/content/content', 'none' );
|
||||||
|
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</main><!-- #main -->
|
||||||
|
</section><!-- #primary -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_footer();
|
||||||
50
theme/single.php
Normal file
50
theme/single.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The template for displaying all single posts
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section id="primary">
|
||||||
|
<main id="main">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/* Start the Loop */
|
||||||
|
while ( have_posts() ) :
|
||||||
|
the_post();
|
||||||
|
get_template_part( 'template-parts/content/content', 'single' );
|
||||||
|
|
||||||
|
if ( is_singular( 'post' ) ) {
|
||||||
|
// Previous/next post navigation.
|
||||||
|
the_post_navigation(
|
||||||
|
array(
|
||||||
|
'next_text' => '<span aria-hidden="true">' . __( 'Next Post', 'familiarosatheme' ) . '</span> ' .
|
||||||
|
'<span class="sr-only">' . __( 'Next post:', 'familiarosatheme' ) . '</span> <br/>' .
|
||||||
|
'<span>%title</span>',
|
||||||
|
'prev_text' => '<span aria-hidden="true">' . __( 'Previous Post', 'familiarosatheme' ) . '</span> ' .
|
||||||
|
'<span class="sr-only">' . __( 'Previous post:', 'familiarosatheme' ) . '</span> <br/>' .
|
||||||
|
'<span>%title</span>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If comments are open, or we have at least one comment, load
|
||||||
|
// the comment template.
|
||||||
|
if ( comments_open() || get_comments_number() ) {
|
||||||
|
comments_template();
|
||||||
|
}
|
||||||
|
|
||||||
|
// End the loop.
|
||||||
|
endwhile;
|
||||||
|
?>
|
||||||
|
|
||||||
|
</main><!-- #main -->
|
||||||
|
</section><!-- #primary -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_footer();
|
||||||
33
theme/template-parts/content/content-excerpt.php
Normal file
33
theme/template-parts/content/content-excerpt.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Template part for displaying post archives and search results
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||||
|
|
||||||
|
<header class="entry-header">
|
||||||
|
<?php
|
||||||
|
if ( is_sticky() && is_home() && ! is_paged() ) {
|
||||||
|
printf( '%s', esc_html_x( 'Featured', 'post', 'familiarosatheme' ) );
|
||||||
|
}
|
||||||
|
the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
|
||||||
|
?>
|
||||||
|
</header><!-- .entry-header -->
|
||||||
|
|
||||||
|
<?php familiarosatheme_post_thumbnail(); ?>
|
||||||
|
|
||||||
|
<div <?php familiarosatheme_content_class( 'entry-content' ); ?>>
|
||||||
|
<?php the_excerpt(); ?>
|
||||||
|
</div><!-- .entry-content -->
|
||||||
|
|
||||||
|
<footer class="entry-footer">
|
||||||
|
<?php familiarosatheme_entry_footer(); ?>
|
||||||
|
</footer><!-- .entry-footer -->
|
||||||
|
|
||||||
|
</article><!-- #post-${ID} -->
|
||||||
76
theme/template-parts/content/content-none.php
Normal file
76
theme/template-parts/content/content-none.php
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Template part for displaying a message when posts are not found
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
|
||||||
|
<header class="page-header">
|
||||||
|
<?php if ( is_search() ) : ?>
|
||||||
|
|
||||||
|
<h1 class="page-title">
|
||||||
|
<?php
|
||||||
|
printf(
|
||||||
|
/* translators: 1: search result title. 2: search term. */
|
||||||
|
'<h1 class="page-title">%1$s <span>%2$s</span></h1>',
|
||||||
|
esc_html__( 'Search results for:', 'familiarosatheme' ),
|
||||||
|
get_search_query()
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<?php else : ?>
|
||||||
|
|
||||||
|
<h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'familiarosatheme' ); ?></h1>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
</header><!-- .page-header -->
|
||||||
|
|
||||||
|
<div <?php familiarosatheme_content_class( 'page-content' ); ?>>
|
||||||
|
<?php
|
||||||
|
if ( is_home() && current_user_can( 'publish_posts' ) ) :
|
||||||
|
?>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<?php esc_html_e( 'Your site is set to show the most recent posts on your homepage, but you haven’t published any posts.', 'familiarosatheme' ); ?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="<?php echo esc_url( admin_url( 'edit.php' ) ); ?>">
|
||||||
|
<?php
|
||||||
|
/* translators: 1: link to WP admin new post page. */
|
||||||
|
esc_html_e( 'Add or publish posts', 'familiarosatheme' );
|
||||||
|
?>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
elseif ( is_search() ) :
|
||||||
|
?>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<?php esc_html_e( 'Your search generated no results. Please try a different search.', 'familiarosatheme' ); ?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_search_form();
|
||||||
|
else :
|
||||||
|
?>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<?php esc_html_e( 'No content matched your request.', 'familiarosatheme' ); ?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_search_form();
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</div><!-- .page-content -->
|
||||||
|
|
||||||
|
</section>
|
||||||
60
theme/template-parts/content/content-page.php
Normal file
60
theme/template-parts/content/content-page.php
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Template part for displaying pages
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||||
|
|
||||||
|
<header class="entry-header">
|
||||||
|
<?php
|
||||||
|
if ( ! is_front_page() ) {
|
||||||
|
the_title( '<h1 class="entry-title">', '</h1>' );
|
||||||
|
} else {
|
||||||
|
the_title( '<h2 class="entry-title">', '</h2>' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</header><!-- .entry-header -->
|
||||||
|
|
||||||
|
<?php familiarosatheme_post_thumbnail(); ?>
|
||||||
|
|
||||||
|
<div <?php familiarosatheme_content_class( 'entry-content' ); ?>>
|
||||||
|
<?php
|
||||||
|
the_content();
|
||||||
|
|
||||||
|
wp_link_pages(
|
||||||
|
array(
|
||||||
|
'before' => '<div>' . __( 'Pages:', 'familiarosatheme' ),
|
||||||
|
'after' => '</div>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div><!-- .entry-content -->
|
||||||
|
|
||||||
|
<?php if ( get_edit_post_link() ) : ?>
|
||||||
|
<footer class="entry-footer">
|
||||||
|
<?php
|
||||||
|
edit_post_link(
|
||||||
|
sprintf(
|
||||||
|
wp_kses(
|
||||||
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
||||||
|
__( 'Edit <span class="sr-only">%s</span>', 'familiarosatheme' ),
|
||||||
|
array(
|
||||||
|
'span' => array(
|
||||||
|
'class' => array(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
get_the_title()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</footer><!-- .entry-footer -->
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</article><!-- #post-<?php the_ID(); ?> -->
|
||||||
56
theme/template-parts/content/content-single.php
Normal file
56
theme/template-parts/content/content-single.php
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Template part for displaying single posts
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||||
|
|
||||||
|
<header class="entry-header">
|
||||||
|
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
|
||||||
|
|
||||||
|
<?php if ( ! is_page() ) : ?>
|
||||||
|
<div class="entry-meta">
|
||||||
|
<?php familiarosatheme_entry_meta(); ?>
|
||||||
|
</div><!-- .entry-meta -->
|
||||||
|
<?php endif; ?>
|
||||||
|
</header><!-- .entry-header -->
|
||||||
|
|
||||||
|
<?php familiarosatheme_post_thumbnail(); ?>
|
||||||
|
|
||||||
|
<div <?php familiarosatheme_content_class( 'entry-content' ); ?>>
|
||||||
|
<?php
|
||||||
|
the_content(
|
||||||
|
sprintf(
|
||||||
|
wp_kses(
|
||||||
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
||||||
|
__( 'Continue reading<span class="sr-only"> "%s"</span>', 'familiarosatheme' ),
|
||||||
|
array(
|
||||||
|
'span' => array(
|
||||||
|
'class' => array(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
get_the_title()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
wp_link_pages(
|
||||||
|
array(
|
||||||
|
'before' => '<div>' . __( 'Pages:', 'familiarosatheme' ),
|
||||||
|
'after' => '</div>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div><!-- .entry-content -->
|
||||||
|
|
||||||
|
<footer class="entry-footer">
|
||||||
|
<?php familiarosatheme_entry_footer(); ?>
|
||||||
|
</footer><!-- .entry-footer -->
|
||||||
|
|
||||||
|
</article><!-- #post-${ID} -->
|
||||||
46
theme/template-parts/content/content.php
Normal file
46
theme/template-parts/content/content.php
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Template part for displaying posts
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||||
|
|
||||||
|
<header class="entry-header">
|
||||||
|
<?php
|
||||||
|
if ( is_sticky() && is_home() && ! is_paged() ) {
|
||||||
|
printf( '<span">%s</span>', esc_html_x( 'Featured', 'post', 'familiarosatheme' ) );
|
||||||
|
}
|
||||||
|
if ( is_singular() ) :
|
||||||
|
the_title( '<h1 class="entry-title">', '</h1>' );
|
||||||
|
else :
|
||||||
|
the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</header><!-- .entry-header -->
|
||||||
|
|
||||||
|
<?php familiarosatheme_post_thumbnail(); ?>
|
||||||
|
|
||||||
|
<div <?php familiarosatheme_content_class( 'entry-content' ); ?>>
|
||||||
|
<?php
|
||||||
|
the_content();
|
||||||
|
|
||||||
|
wp_link_pages(
|
||||||
|
array(
|
||||||
|
'before' => '<div>' . __( 'Pages:', 'familiarosatheme' ),
|
||||||
|
'after' => '</div>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div><!-- .entry-content -->
|
||||||
|
|
||||||
|
<footer class="entry-footer">
|
||||||
|
<?php familiarosatheme_entry_footer(); ?>
|
||||||
|
</footer><!-- .entry-footer -->
|
||||||
|
|
||||||
|
</article><!-- #post-${ID} -->
|
||||||
52
theme/template-parts/layout/footer-content.php
Normal file
52
theme/template-parts/layout/footer-content.php
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Template part for displaying the footer content
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<footer id="colophon">
|
||||||
|
|
||||||
|
<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
|
||||||
|
<aside role="complementary" aria-label="<?php esc_attr_e( 'Footer', 'familiarosatheme' ); ?>">
|
||||||
|
<?php dynamic_sidebar( 'sidebar-1' ); ?>
|
||||||
|
</aside>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ( has_nav_menu( 'menu-2' ) ) : ?>
|
||||||
|
<nav aria-label="<?php esc_attr_e( 'Footer Menu', 'familiarosatheme' ); ?>">
|
||||||
|
<?php
|
||||||
|
wp_nav_menu(
|
||||||
|
array(
|
||||||
|
'theme_location' => 'menu-2',
|
||||||
|
'menu_class' => 'footer-menu',
|
||||||
|
'depth' => 1,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</nav>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<?php
|
||||||
|
$familiarosatheme_blog_info = get_bloginfo( 'name' );
|
||||||
|
if ( ! empty( $familiarosatheme_blog_info ) ) :
|
||||||
|
?>
|
||||||
|
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>,
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
|
||||||
|
/* translators: 1: WordPress link, 2: WordPress. */
|
||||||
|
printf(
|
||||||
|
'<a href="%1$s">proudly powered by %2$s</a>.',
|
||||||
|
esc_url( __( 'https://wordpress.org/', 'familiarosatheme' ) ),
|
||||||
|
'WordPress'
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</footer><!-- #colophon -->
|
||||||
47
theme/template-parts/layout/header-content.php
Normal file
47
theme/template-parts/layout/header-content.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Template part for displaying the header content
|
||||||
|
*
|
||||||
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
|
*
|
||||||
|
* @package FamiliaRosaTheme
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<header id="masthead">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<?php
|
||||||
|
if ( is_front_page() ) :
|
||||||
|
?>
|
||||||
|
<h1><?php bloginfo( 'name' ); ?></h1>
|
||||||
|
<?php
|
||||||
|
else :
|
||||||
|
?>
|
||||||
|
<p><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
|
||||||
|
$familiarosatheme_description = get_bloginfo( 'description', 'display' );
|
||||||
|
if ( $familiarosatheme_description || is_customize_preview() ) :
|
||||||
|
?>
|
||||||
|
<p><?php echo $familiarosatheme_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<nav id="site-navigation" aria-label="<?php esc_attr_e( 'Main Navigation', 'familiarosatheme' ); ?>">
|
||||||
|
<button aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', 'familiarosatheme' ); ?></button>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
wp_nav_menu(
|
||||||
|
array(
|
||||||
|
'theme_location' => 'menu-1',
|
||||||
|
'menu_id' => 'primary-menu',
|
||||||
|
'items_wrap' => '<ul id="%1$s" class="%2$s" aria-label="submenu">%3$s</ul>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</nav><!-- #site-navigation -->
|
||||||
|
|
||||||
|
</header><!-- #masthead -->
|
||||||
39
theme/theme.json
Normal file
39
theme/theme.json
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/theme.json",
|
||||||
|
"version": 3,
|
||||||
|
"settings": {
|
||||||
|
"color": {
|
||||||
|
"palette": [
|
||||||
|
{
|
||||||
|
"slug": "background",
|
||||||
|
"color": "#ffffff",
|
||||||
|
"name": "Background"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"slug": "foreground",
|
||||||
|
"color": "#404040",
|
||||||
|
"name": "Foreground"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"slug": "primary",
|
||||||
|
"color": "#b91c1c",
|
||||||
|
"name": "Primary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"slug": "secondary",
|
||||||
|
"color": "#15803d",
|
||||||
|
"name": "Secondary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"slug": "tertiary",
|
||||||
|
"color": "#0369a1",
|
||||||
|
"name": "Tertiary"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"layout": {
|
||||||
|
"contentSize": "40rem",
|
||||||
|
"wideSize": "60rem"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user