THIS IS THE EX-OFFICIAL KITEANDROCKET WORDPRESS THEME
This theme built on Roots Sage v9.0.9 which uses Laravel's Blade templating engine
If you are comfortable working with Roots Sage, just jump to the theme usage section
This README file is specific to this theme but it draws some usage instructions directly from the default Sage README which was renamed to make room for this one.
WordPress Info
- PHP 7.4.1
- Apache
- MySQL 8.0.16
- Wordpress 5.5
- Wordpress Plugins
- Admin Columns v4.2.2
- Admin Menu Editor v1.9.7
- Advanced Custom Fields 5.x
- Category Order and Taxonomy Terms Order
- Classic Editor
- iThemes Security
- SuperCPT 0.2.1 -Very old but hey, it works
- Post Types Order v1.9.5.2
- Really Simple SSL v4.0.3
- Yoast SEO v15.4
- My werid custom plugin for setting up the custom post types TODO: Remember to upload somewhere
Template Information
- Roots Sage v9.0.9
- Laravel Blade 5.something
Table of Contents
This theme uses yarn over npm. Still not entirely sure of the difference but I've just been using yarn because the Sage docs said to.
See the sage README.md for requirements and very detailed setup instructions under theme development
yarn start
— Compile assets when file changes are made, start Browsersync sessionyarn build
— Compile and optimize the files in your assets directoryyarn build:production
— Compile assets for production
Full sage theme file structure
General Summary
A few directories and files not to manually edit ( edits could break the things, e.g. build errors that never go away):
dist/
- this is where the build goesvendor/
node_modules/
- yarn handles all of thiscomposer.lock
A few directories and files files you can, and probably will, modify:
- asset stuff:
resources/assets/
images/
scripts/
styles/
- almost all of
resources/views
but probably notresources/views/app.blade.php
- be careful with
app/
JS route configuration and routes: resources/assets/scripts/main.js
and resources/assets/scripts/routes
WordPress global php functions are usually in resources/functions.php but now the filters, helpers, and setup stuff should be broken into the corresponding php files in app/
such as filters.php
, helpers.php
, and setup .php
Route-specific (controllers) PHP functions can be found in app/Controllers
. These define functions that run when a page is loaded or functions a page can call.
This theme is built on a customized version of Bootstrap v4.5.3
All customizations to bootstrap are in assets/styles/common/_bootstrap-variables.scss
Non-boostrap-related styles are broken into corresponding scss files which are imported into main.scss.
All scss modules in node_modules
are also imported into main.scss
Working with the scss in resources/assets/styles:
Which file do I write my styling in?
Because this site requires a lot of styling, it is best to break the code into chunks and import each "chunk" into main. This simplifies the code a lot and also assists with debugging. Luckily, the Roots Sage people set the main.scss file up with imports from a bunch of labeled scss files.
So, how do I know which file to put my styling code in?
Take a look at the order of imports in main.scss. There's a reason css is called cascading style sheets. It's best to leave the order of imports alone. It's already organized pretty well.
In the order they are imported in main.scss, here's how I thought of the usage of the style files
common/bootstrap-variables
- scss variables for customizing bootstrapcommon/global-variables
- scss variables for customizing any other packages and for your own use./autoload/**/*
- loads_bootstrap.scss
and_npm-dependencies
WHICH YOU SHOULD USEcommon/global
- I honestly am just using it to store stuff I need everything else to be able to acess (e.g@mixin
, font stuff...)components/global_swiper
- swiper styling for all swipers (since theres one for the video post page and one on the ideabank page)components/buttons
- general button styling. I also defined the base link styling for<a>
tags.components/forms
- the sidebar search form is the only current formcomponents/main-video
- styling the main video player (the wistia video div)components/video-sharing-modal
- styling the button and modal for sharing the main videocomponents/swiper-video-category-row
- styling the video category rowscomponents/video-cards
- because the.video-card
class is used in both the video post pages and the search results, the styling here is not used in the scss file for postslayouts/header
- styling for the big kite and rocket header at the top of every page. The actual header is imported in the root template for every page on the site. The actual header partial can be found in :assets/views/partials/header.blade.php
layouts/sidebar
- styling for all the nav menuslayouts/footer
- footer stylinglayouts/pages
- STATIC PAGES (basically everything but the post pages)layouts/posts
- Just for the single-view posts/home page
You can view the bootstrap variable defaults here You can read more on theming bootstrap here
To lint styles, run yarn run lint:styles
or my custom pet name for it, yarn run lies
Working with the scripts in resources/assets/scripts
:
main.js
- the primary js file and hub for most js imports and route setuproutes/
- directory with all the routesroutes/common.js
- the code that runs on every page that enables the share buttonroutes/ideabank.js
- the code that runs on ideabank that initializes swiperroutes/singleKrvideo.js
- the code that runs on a krvideo post page that initializes swiper and
Roots Sage uses Laravel's Blade templating engine
The template file structure follows that of wordpress.
The main templates are located in resources/views
The partials are located in resources/views/partials
The main file which wraps every post page is resources/views/layouts/app.blade.php
. It is best not to modify this one.
All file modifications should me made with with CARE and CAUTION as they are all linked to one another
front-page.blade.php
- page view for the main landing/home page; - redirects to featured video, otherwise uses latest videosingle-krvideo.blade.php
- page for a singluar video-post page - main video at top, the rest of the video posts in their categroies belowpartials/content-single-krvideo.blade.php
- the partial for displaying a specific video post on its own page - uses main-videocomponents/main-video.blade.php
- the partial for displaying the main video player and description
components/swiper-video-category-row.blade.php
- the partial for displaying the video category swiper rowscomponents/video-card.blade.php
- individual video card (for use with swiper slides or not)
search.blade.php
- the search results pagepage-ideabank.blade.php
- the ideabank pagepage-labcam.blade.php
- the labcam page
While functions.php
ususally contains integral functions for site setup and helper functions - with Sage it's best to stick them in one of the files in app/
The directory app/
has a lot of stuff that goes above and beyond wodpress's functions.php. The files filters.php
, helpers.php
, and setup.php
should be used in the place of functions.php.
On controllers
app/Controllers/
is a wonderful directory. Here's where you can define php funtions to either automatically run once a page runs or define helper functions for pages to use when needed.
On helper functions
Global functions are not always acessible from all files, use \
(e.g. \WP_Query($args);
) to acess them. Other functions need to be referenced by their namespace, e.g. App\get_latest_krvideo()
You can read more about namespaces here.
Comments
{{-- this is a comment --}}
Depositing php values (without needing to use echo
)
{{ php_function_here(params...) }}
PHP function for getting video metadata inside a while loop
the_field('field_meta')