Upload your Bedrock/Sage theme to Cpanel Hosting

In this section, we will get Bedrock set up on Cpanel hosting. In the advanced section of the Cpanel hosting panel, you should find the terminal. Run this command

Get to the public root directory, here you need to create new folder for a subdomain and go into that folder if you are following along. You can also use the domain root, but this will need you to make some changes to the document root later on to make this work. Once you have created your new folder, cd into it before running the install commands.

cd public_html

now run the install commands for bedrock

composer create-project roots/bedrock

Upload your theme, DONT UPLOAD the node_modules folder! Before you do this build in your local environment using:

npm run build:production

Upload to :

bedrock/web/app/themes/

In local grab a copy of the database … Click the database tab, then “Adminer” you will likely have an error 404 – just wait for a second… Hopefully, that fixed itself, phew! Now click Export :

the defaults will be fine:

Okay, from Cpanel make a new database (in the MySql Databases option), Now create a new user, and add the user to the DB. Load up PhpMyAdmin and choose the new Database you created, click “Sql” and paste everything output by the export function in Local Adminer.

Now go to cpanel > File Manager > Navigate to the “Bedrock” Folder. In the top right click “Settings” Select “Show Hidden Files” (Mine shoed it was selected, but I needed to click and save the checkbox before I could “actually” see hidden files! Rename the file .env.example to .env and edit the file, You need to change lines 1,2,3,13,14. These lines will be Database, username, password and URL, so have these ready. Once done generate new salts by visiting the link in the file, and pasting the result back.

Now, we need to update the document root. I’m doing this with a subdomain here (easy) but you can also do it with the document root if you have access to whm, or contact your host. Create a new subdomain using the folder you used to put the files in.

Set up new Document root.

Lastly, go back to your .env file and update lines 13,14

WP_ENV='production'
WP_HOME='https://examplesite.yourdomain.com'

Now visit the admin panel (https://yoursubdomain.yourdomain.com/wp/wp-admin)

Change your password!

Now, BEFORE ANYTHING ELSE change your login password. Until now you have been developing locally and are probably using an insecure password, you have just copied the DB to a live site, your password now needs to be secure.

go to themes, and activate your new theme!

Now, back to the terminal in Cpanel, navigate to your new theme directory

cd public_html/examplesite/bedrock/web/app/themes/yourtheme

run install

composer install

in bedrock/config/environments/ create the file “production.php”

I always allow plugins to be updated and added from the wp-admin, so add this to the file if needed:

Config::define('DISALLOW_FILE_MODS', false);

Now back to PhpMyAdmin, we need to update the site url from the localhost one to the live url. Update the first 2 items in wp_options

Last thing, go to Settings > Permalinks > Save

So, did it work? If you want the site to be on the root of the domain and not a subdomain (which to be honest is usually the case) you will need full root access to your server. It really isnt too hard to do, but I realize many may not have the required access so decided to write the tutorial based on a subdomain. You can follow all the steps listed, but follow this guide to update your document root from WHM. You may also want to do a refresher on saving and navigating using vim.

Remember this stuff never gets easier, you just get better – and if you have got through all of this you are doing awesome!

WordPress Widget Footer Grid

Sage comes with a footer sidebar ready to go, so we will change this to a 3 column grid where it will space out 1-3 widgets across the bottom of the footer. Sage comes with an empty stylesheet for the footer scss, but first let’s create the class we need to style it as we need. Load up the footer template, located in resources/views/partials/footer.blade.php

In this file we have a container that sets the margins on the left and right and puts the content in the middle, this is opened after the footer so we can target the footer background color directly and it will be full width. We do however need to create a new DIV which will become our grid container. Here is my footer file with the new div and class added :

<footer class="content-info">
  <div class="container">
     <div class="widget-grid">
    @php dynamic_sidebar('sidebar-footer') @endphp
    <div>
  </div>
</footer>

To setup the grid we need to go to resources/assets/styles/_footer.scss and we will target the widget-grid class we just added.

.widget-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 2rem;
  margin: 20px;
}

This creates a grid that spreads out 3 columns equally across the available space. Note that you can easily change the number of supported columns and widgets if you wanted 4 widgets across the footer just change to this repeat(4, 1fr);

Our previous widget styling CSS needs a little update for the footer as it will be over a different color background. Here is the CSS to update the background color and change the font and line colors.

footer.content-info {
  background-color: theme-color("primary");
  color: #f0f0f0;
}

footer .widget h3 {
  border-bottom-color: theme-color("secondary-yellow");
}

footer .line {
  border-bottom-color: theme-color("navtop");
}

footer a {
  color: white;
}

If we add a few widgets to the footer sidebar we will end up with something a little like this :

WordPress Footer sidebar

Spend a little time styling these widgets, the contact one would look great with a few FontAwesome icons, perhaps add social icons here also.

Sage Sidebars

In this tutorial, we will be adding a new sidebar called “sidebar-post”, and assign both the primary and new sidebar to various pages.

Register a new sidebar

We will register the new sidebar in the setup file – this is located in app/setup.php around line 80. I will add the new “Post Sidebar” to the end of this code, so it now looks like this:

add_action('widgets_init', function () {
    $config = [
        'before_widget' => '<section class="widget %1$s %2$s">',
        'after_widget' => '</section>',
        'before_title' => '<h3>',
        'after_title' => '</h3>',
    ];
    register_sidebar([
        'name' => __('Primary', 'sage'),
        'id' => 'sidebar-primary',
    ] + $config);
    register_sidebar([
        'name' => __('Footer', 'sage'),
        'id' => 'sidebar-footer',
    ] + $config);
        register_sidebar([
        'name' => __('Post Sidebar', 'sage'),
        'id' => 'sidebar-side-post',
    ] + $config);
});

Our new sidebar is now registered in our widget area, go to Appearance/widgets in your admin panel to make sure it all works correctly, you should see 3 sidebars :

By default Sage does nothing with these, it sets them up and steps away. It leaves us free to develop the theme without any defaults. Our next task is to implement these sidebars so they output to various page templates. We have lots of ways we can achieve this, We need the content to be full width when no sidebar is displayed, yet split into columns when it is displayed. In previous versions of Bootstrap, this was a pain, but in Bootstrap 5 we are able to only set one column width, and the other column will fill in space. This allows for a nice elegant solution without the need for any PHP class shinanigans.

in views/layout/app.blade.php file is changed to this:

<!doctype html>
<html {!! get_language_attributes() !!}>
  @include('partials.head')
  <body @php body_class() @endphp>
    @php do_action('get_header') @endphp
    @include('partials.header')
    <div class="wrap container" role="document">

      <div class="content">
         <div class="row">
           <div class="col">
        <main class="main">
          @yield('content')
        </main>
      </div>
        @if (App\display_sidebar())
            @include('partials.sidebar')
        @endif
      </div>
</div>
</div>
    @php do_action('get_footer') @endphp
    @include('partials.footer')
    @php wp_footer() @endphp
  </body>
</html>

We have removed the sidebar aside in the if statement, and we have added div tags for the bootstrap row and column.

in assets/views/partials/sidebar.blade.php

   <aside class="sidebar col-md-4">
@php dynamic_sidebar('sidebar-primary') @endphp
  </aside>

We add the column width to this sidebar, and we let bootstrap stack the sidebar based on screen size. You can have the sidebar displaying on small screens (≥576px) using col-sm-4, I decided to display if ≥768px using col-md-4

I also want to apply some initial styling, I will put these rules into the generic stylesheet rather than creating and importing a new one, these rules have been added to: resources/assets/styles/common/_global.scss

.widget {
  padding: 10px;
  background-color: theme-color("navtop");
  margin-bottom: 20px;
}

.widget h3 {
  border-bottom-width: 3px;
  border-bottom-style: solid;
  border-bottom-color: lightgray;
}

.line {
  border-bottom-width: 3px;
  border-bottom-style: solid;
  border-bottom-color: theme-color("primary");
  display: inline-block;
  margin: 0 0 -3px 0;
  padding: 10px 3px;
}

and lastly we need to apply a new class in the app/setup.js file, in the register sidebars section (around line 80) I have added a span in the before and after title array.

add_action('widgets_init', function () {
    $config = [
        'before_widget' => '<section class="widget %1$s %2$s">',
        'after_widget' => '</section>',
        'before_title' => '<h3><span class="line">',
        'after_title' => '</span></h3>',
    ];

Your main page should be full screen without a sidebar, and the post pages should like this

Sage Sidebars

If you are following along, now is a good time to make sure everything is working as you resize your browser. Check that the sidebars collapse as the screenspace is reduced, that the hamburger menu appears and we have no display issues across browser sizes.

Create Different Sidebars

We added a new sidebar called “Post Sidebar” earlier, let’s use that on the single page. Eventually, we can have different widgets for this more relevant to the post such as “by the same author” for now, let’s put some logic in resources/views/partials/sidebar.blade.php

 @if (is_single())
 <aside class="sidebar col-md-4">
@php(dynamic_sidebar('sidebar-side-post'))
 </aside>
@else
<aside class="sidebar col-md-4">
@php(dynamic_sidebar('sidebar-primary'))
 </aside>
@endif

From your admin panel add a few widgets to the Post Sidebar. You should see the new sidebar is used in the post pages.

Next, we will take a brief interlude to make a quick plugin for a new widget to style the new posts a little better. This plugin will be used for various site code as we progress through the theme building process.

Finishing off our Header – Sage tutorial

Our header has come a long way from that early unordered list, but we should finish off our styling and ongoing issues before we continue.

Hamburger Menu in Sage not displaying

So this was an issue I had – and it seems others have also, but it’s worth checking to see if this even an issue for you before you apply my fix. If you resize your window do you see the Hamburger Menu? if not, then it seems to stem from a fix applied for a bug which to my knowledge doesn’t need fixing in the latest version of Bootstrap. Load up resources/styles/_variables.scss and comment out the last 2 lines :

/** Bootstrap navbar fix (https://git.io/fADqW) */
// $navbar-dark-toggler-icon-bg: none;
// $navbar-light-toggler-icon-bg: none;

We also need to add the following class to the nav in header.blade.php “navbar-dark”

<nav class="navbar navbar-dark navbar-expand-md nav-custom sticky-top" role="navigation">

Your mobile menu should now appear.

More space between menu and content

This is perhaps a personal preference, but I prefer a little more space after the navbar. I added this to the _navbar.css file we created :

.navbar {
  margin-bottom: 10px;
}

With the extra space I liked the look of a slight box shadow:

.navbar {
  margin-bottom: 10px;
  box-shadow: rgba(17, 17, 26, 0.2) 0 2px 3px;
}

Better accessibility with higher contrast

The color I chose for the navbar is between dark and light. The default Bootstrap styling assumes a darker background and creates links that don’t have the required contrast. You may not have this issue if your navbar is a different color to mine. To fix this we have to use an !important tag. In our _navbar.scss file :

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}

the default opacity is 0.5, I increased mine to 0.9 which will pass accessibility tests, but you could use plain white instead and save a few characters in the css file like this :

.navbar-nav .nav-link {
  color: #fff !important;
}

Change dropdown background

I changed my mind and went for a lighter color for the dropdown, in _navbar.scss I changed to this :

.dropdown-menu {
  background-color: #2c2455;
}

Fix sticky header with admin bar

The space the admin bar takes up causes a display issue with the sticky header. This CSS code will fix it on mobile and desktop version of the site.

body.admin-bar .sticky-top {
  top: 32px;
}

@media all and (max-width: 782px) {
  body.admin-bar .sticky-top {
    top: 0;
  }
}

Change search icon color

I removed the class (text-white) that changed the icon to white, from header.blade.php to fix contrast issue.

      <span class="input-group-text" >
        <i class="fas fa-search"></i>
      </span>

Re-organize colors.

I like to build out sections and play with the colors, once I am happy with them I will rename them and create variables for them. Now I have decided on 2 theme colors in the menu, I will call these primary and primary-dark. It’s now time to set these up so we have access to them throughout the tutorial. The best thing with developing this way is we will be able to quickly alter the theme colors from one file in the future.

in resources/styles/common/_variables.scss Sage already has this ready to go – so lets just make a few changes, this is my file now :

$theme-colors: (
  primary: #483c8a,
  primary-dark: #2c2455,
  secondary-yellow: #dea226,
  navtop: #f5f5f5,
);

and we reference each of these colors like this :

  background-color: theme-color("primary-dark");

Lets go through our _navbar.scss file and make any necessary changes. Here is my file now :

.brand {
  margin-right: 2rem;
  font-size: 1.2em;
  text-decoration: none;
  color: black;
}

.top-header {
  padding: 10px;
  background-color: theme-color("navtop");
  border-top: #202331 4px solid;
  box-shadow: rgba(0, 0, 0, 0.1) 0 30px 50px -12px inset;
  box-shadow: rgba(0, 0, 0, 0.3) 0 15px 32px -18px inset;
}

.nav-custom {
  background-color: theme-color("primary");
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}

.nav-custom a {
  color: white;
}

.dropdown-menu {
  background-color: theme-color("primary-dark");
}

.social {
  color: theme-color("primary");
  transition: all ease-out 0.5s;
  -moz-transition: all ease-out 0.5s;
  -webkit-transition: all ease-out 0.5s;
  -o-transition: all ease-out 0.5s;
}

.social:hover {
  text-shadow: 0 5px 5px rgba(0, 0, 0, 0.3);
  transition: all ease 0.5s;
  -moz-transition: all ease-in 0.5s;
  -webkit-transition: all ease-in 0.5s;
  -o-transition: all ease-in 0.5s;
}

.facebook:hover {
  color: #4267b2;
}

.twitter:hover {
  color: #1da1f2;
}

.youtube:hover {
  color: #c4302b;
}

.pinterest:hover {
  color: #c8232c;
}

.instagram:hover {
  color: #fada5e;
}

.navbar {
  margin-bottom: 10px;
  box-shadow: rgba(17, 17, 26, 0.2) 0 2px 3px;
}

body.admin-bar .sticky-top {
  top: 32px;
}

@media all and (max-width: 782px) {
  body.admin-bar .sticky-top {
    top: 0;
  }
}

We can now reference these colors in lots of places yet have one central area to make color changes.

In our next instalment we will be working with sidebars

Add a Template Partial in Sage

As part of the header design I wanted to add another area above the navbar to contain social icons and the search bar. As we scroll down this are will disappear and the nav element will become sticky to the top of the page. This is what we will achieve in todays post, or if you are not following along with the series as we create a new theme from scratch using Sage, you can just read this post to learn about creating template partials.

We could just put all our code for this in the header.blade.php file, but it’s better to organize and split up the code into smaller chunks so we will be creating a header-top.blade.php file to contain the new code. This is called a template partial. We will be calling this in the header.blade.php file. Lets first create the new php file :

resources/views/partials/header-top.blade.php

For now just write some placeholder text in the file and save.

Load up resources/views/partials/header.blade.php and at the top of the file add this :

@include('partials.header-top')

You should now see the placeholder text appear above your menu bar. Lets also add the class “sticky-top” to the nav tag class list, so it should now look like :

<nav class="navbar navbar-expand-md navbar-light bg-light sticky-top" 

As we scroll down the Navbar will stick to the top of the page.

Let’s style our new templated section. Our _navbar.scss file that we created in a previous step should be located in resources/styles, replace the contents with this :

.brand {
  margin-right: 2rem;
  font-size: 1.2em;
  text-decoration: none;
  color: black;
}

.top-header {
  padding: 10px;
  background-color: whitesmoke;
  border-top: #202331 4px solid;
  box-shadow: rgba(0, 0, 0, 0.1) 0 30px 50px -12px inset;
  box-shadow: rgba(0, 0, 0, 0.3) 0 15px 32px -18px inset;
}

.nav-custom {
  background-color: darkslateblue;
}

.nav-custom a {
  color: white;
}

.dropdown-menu {
  background-color: #202331;
}

.social {
  color: darkslateblue;
  transition: all ease-out 0.5s;
  -moz-transition: all ease-out 0.5s;
  -webkit-transition: all ease-out 0.5s;
  -o-transition: all ease-out 0.5s;
}

.social:hover {
  text-shadow: 0 5px 5px rgba(0, 0, 0, 0.3);
  transition: all ease 0.5s;
  -moz-transition: all ease-in 0.5s;
  -webkit-transition: all ease-in 0.5s;
  -o-transition: all ease-in 0.5s;
}

.facebook:hover {
  color: #4267b2;
}

.twitter:hover {
  color: #1da1f2;
}

.youtube:hover {
  color: #c4302b;
}

.pinterest:hover {
  color: #c8232c;
}

.instagram:hover {
  color: #fada5e;
}

Remove the search form we added in header.blade.php as we will be putting it in our new top area. In our header-top.blade.php file replace the contents with the following code :


<div class="top-header">
<div class="wrap container">
<div class="d-flex justify-content-between">
<div class="align-self-center">

<div class="wrapper">
<a href="#"><i class="fab fa-facebook social  facebook "></i></a>
<a href="#"><i class="fab fa-pinterest social  pinterest "></i></a>
<a href="#"><i class="fab fa-twitter social  twitter "></i></a>
<a href="#"><i class="fab fa-instagram social  instagram "></i></a>

</div>

</div>
 <div>
    <form class="d-flex input-group w-auto">
      <input
        type="search"
        class="form-control rounded"
        placeholder="Search"
        aria-label="Search"
        aria-describedby="search-menu"
      />
      <span class="input-group-text text-white" >
        <i class="fas fa-search"></i>
      </span>
    </form></div>

</div>
</div>
</div>

This is not a styling tutorial so I won’t be going into detail on this, I generated the social media icons from my generator page and a box-shadow to the top menu using my box-shadow generator. It uses bootstraps d-flex class, to create a flexbox, and the “align-self-center” class to space vertically. We also use <div class=”wrap container”> to space the content correctly. Our header should now be styled like this :

We have a few small things left to fix, which we will tackle in the next section where we will finish off our header area. In a previous section we imported the Facebook and Twitter icons, we are missing fa-instagram and fa-pinterest. I did this for 2 reasons, the first to illustrate that we haven’t loaded the entire FontAwesome Library – just the icons we needed, and lastly to give you an opportunity to fix this yourself to help retain the information better. So, see if you can fix the missing icons, and I will see you in the next section!

Add Font Awesome to Sage Theme

We are going to use a few icons from FontAwesome. With a little bit of extra work we can import only the icons we need, instead of the entire library (10x faster according to FortAwesome), We are aiming to make a theme with 95%-100% rating for page speed, so this extra work is essential to this aim.

I plan on using some social media icons and a search bar in the nav menu we have just created, so before we move onto that let’s spend some time learning how to correctly import these icons. From our terminal window, run this command :

yarn add @fortawesome/fontawesome-svg-core

We will need to now add the individual font libraries that we will be picking font from, for me they will be the most common 2 :

yarn add @fortawesome/free-solid-svg-icons
yarn add @fortawesome/free-brands-svg-icons

Next, we need to choose the individual icons that we will be loading, to do this, we will be exploring the resources/assets/scripts/main.js file, add the following :

import { library, dom } from '@fortawesome/fontawesome-svg-core';
import { faFacebook, faTwitter } from "@fortawesome/free-brands-svg-icons";
import { faSearch } from '@fortawesome/free-solid-svg-icons';
library.add(faFacebook, faTwitter, faSearch);

dom.watch();

To import new icons to use, we will need to come back to this file and add it to the icon name object and library.add

If you are following along with this series, lets make sure everything is working and replace the header.blade.php file with the following :

<nav class="navbar navbar-expand-md navbar-light bg-light" role="navigation">
  <div class="container">

    <!-- Brand and toggle get grouped for better mobile display -->
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-controls="bs-example-navbar-collapse-1" aria-expanded="false" aria-label="<?php esc_attr_e('Toggle navigation', 'your-theme-slug'); ?>">
        <span class="navbar-toggler-icon"></span>
    </button>
   <!-- <a class="brand" href="{{ home_url('/') }}">{{ get_bloginfo('name', 'display') }}</a> -->

   @if (has_nav_menu('primary_navigation'))
  {!! wp_nav_menu(['theme_location' => 'primary_navigation',
    'depth'           => 2, // 1 = no dropdowns, 2 = with dropdowns.
    'container'       => 'div',
    'container_class' => 'collapse navbar-collapse',
    'container_id'    => 'bs-example-navbar-collapse-1',
    'menu_class'      => 'navbar-nav mr-auto',
    'fallback_cb'     => 'WP_Bootstrap_Navwalker::fallback',
    'walker'          => new WP_Bootstrap_Navwalker()]) !!}
@endif


    <form class="d-flex input-group w-auto">
      <input
        type="search"
        class="form-control rounded"
        placeholder="Search"
        aria-label="Search"
        aria-describedby="search-menu"
      />
      <span class="input-group-text text-white" >
        <i class="fas fa-search"></i>
      </span>
    </form>

    </div>

</nav>

We should now see the search icon image next to a search box. We will be modifying this search box shortly, and changing the header significantly in the next tutorial.

Parallax WordPress Hero Tutorial

Check out the front page to see this in action. This style of parallax works great as a front-page “Hero Image”. It’s coded with just some CSS. It does however require you to make some coding changes to the template, and because your template file WILL be different from mine you should only do this if you understand the code enough to make the relevant changes. In this tutorial, we will be making all the changes in the front-page.php file. Your theme may not have this file… If that is the case I would recommend copying the index.php file and renaming the copy as “front-page.php” this template affects ONLY the main page. Remember to copy this into your child theme folder.

Source a cover image for the Parallax Header

Firstly, find yourself a great cover image. Some space on the left, right, or center of the image will allow you to have a clutter-free area for the text and button. Check out Pexels, Unsplash, and Pixabay who each offer free stock images or illustrations that might work for your needs., I personally LOVE vectorstock.com – you can get quality illustrations (with .ai .eps .jpeg versions of each file and it costs just $1 per image if you buy a credit pack) Vector stock is where I downloaded the image on our front page if you wanted to use the same one.

You will likely need to make a few changes to the image, we will be using the CSS “cover” which makes the image always display at 100% width, this causes the image to be cropped, sometimes significantly when viewed on different sizes of screen. Make sure the main focus of the image is near the center or slightly offset if you plan on having text on the left or right side of the image. Also make sure a good portion of the edges is background, or un-important enough that cropping will not matter. Have a look at the rough example below.

Target Image size for cover css

Add the HTML Structure

Next, we are going to create the HTML structure. Load up the front-page.php file. Your file is likely different from mine, so you may need to adjust this a little, lets take it slowly, first off look at the template for the function that calls in the header template. It will look like this :

<? get_header(); ?>

This outputs your header and your menu – immediately below this we want the parallax hero section, paste this code making the relevant changes to the text. Warning: your template file may have extra logic and PHP code, you will need to find the right place to put this code in your own setup.


<div class="paralax-a">
  <header id="para">
	<div class="hero-text">
            <h1>TheWPGeek.com</h1>
            <p>Web Development - with a focus on WordPress</p>
        <div class="wp-block-button is-style-fill"><a class="wp-block-button__link">Learn to make this Parallax Header.</a></div>
     </div>
  </header>

The observant among you will notice that this code does not close the initial <div> tag. This will need to be closed AFTER the content on the page has been output. In the same front-page.php file you will find some code that looks like this :

<?php
get_footer();

Just above that, we need to close out initial <div> so it will now look like this :

</div>
<?php
get_footer();

Now we need to load up the style sheet, usually style.css in your child theme folder.

Add the CSS code

Before we paste this code take a look at your front-page.php file, and see what your theme has named the <main> tag, here is mine :

<main id="primary" class="site-main">

if you do not have an id, add one called primary (id=”primary”).


.paralax-a {
	height: 200vh;
	max-height: 100%;
	overflow-x: hidden;
	perspective: 1px;
	perspective-origin: center top;
	transform-style: preserve-3d;
	padding: 0 40px;
}

#para {
	height: 50vh;
	background: url("/wp-content/uploads/2021/06/hero-copy.jpg");
	background-size: cover;
	background-position: center center;
	position: relative;
	vertical-align: top;
	transform-origin: center top;
	transform: translateZ(-1px) scale(2);
	box-shadow: rgba(0, 0, 0, 0.6) 0px 30px 50px -12px inset,
		rgba(0, 0, 0, 0.6) 0px 15px 32px -18px inset;
	background-color: rgba(255, 255, 255, 1);
}
#primary {
	height: 100%;
	background: white;
	transform: translateZ(0);
	padding: 10px 0;
}
.hero-text {
	text-align: center;
	position: absolute;
	top: 50%;
	left: 70%;
	transform: translate(-50%, -50%);
	color: white;
}

Upload the hero image to your media library, and then copy the url and paste it into the stylesheet replacing this :

background: url("/wp-content/uploads/2021/06/hero-copy.jpg");

the alignment of the text is controlled by this in the .hero-text CSS

left: 70%;

30% pushes it to the right, 50% will align to the centre. For my image 70% aligned the image perfectly for my needs.

Notes

As this CSS code is not used elsewhere on the site you could also add it to the page itself.

As my text is not directly in the middle it does not work well on small screens, we will need to add a media query to either centralize the text or resize accordingly. For me, text in the middle does not work as it becomes cluttered with the image, I made the decision to remove the text completely from the image. A better solution would be to use a grid layout for the text, and a media query to change the column layout for small screens.

@media only screen and (max-width: 600px) {
	.hero-text {
		display: none;
	}
}

Box Shadow Wizard

Box Shadow Wizard

Choose from one of the gorgeous box-shadow examples and make live modifications to the style. Check back as we will be adding more curated styles regularly.

Step 1: Choose a Box Shadow Base Style


Step 2: Fine-Tune the Box-Shadow

The Box Shadow :

Opacity:
No Value Selected
Box Color:
No Value Selected
Shadow Color:
No Value Selected

Your Settings :

Shadow Color
Base color of the drop shadow
Background Color
Base background
Opacity
Start Shadow Opacity

Radius
Corner Radius Value
Individual Corner Radius
Change one corner radius seperate from the others.

Generated CSS Box Shadow Code :

Make modifications or choose a box-shadow style and the CSS code will appear here.