Skip to content

Instantly share code, notes, and snippets.

@renemorozowich
renemorozowich / functions.php
Last active October 11, 2019 13:25
Add a top menu AND a bottom menu (after header) to an Astra child theme
/**
* Add additional menus
*/
function register_additional_menus() {
register_nav_menu( 'top-menu', __( 'Top Menu' ) );
register_nav_menu( 'bottom-menu', __( 'Bottom Menu' ) );
}
add_action( 'init', 'register_additional_menus' );
/**
@renemorozowich
renemorozowich / style.css
Created October 11, 2019 13:19
Style a bottom menu (after header) added to an Astra child theme
.bottom-header-bar {
background-color: #ff0000;
text-align: right;
padding: 10px 0;
}
#menu-bottom {
margin: 0;
}
@renemorozowich
renemorozowich / functions.php
Created October 11, 2019 13:15
Add a bottom menu (after header) to an Astra child theme
/**
* Add additional menu
*/
function register_additional_menus() {
register_nav_menu( 'bottom-menu', __( 'Bottom Menu' ) );
}
add_action( 'init', 'register_additional_menus' );
/**
* Add scripts to astra_header_after
@renemorozowich
renemorozowich / script.js
Created June 20, 2019 13:50
Basic JS file with a toggle
// get the button
var btnContent = document.getElementById("btn-content");
// add a click event
btnContent.addEventListener("click", toggleContent);
// get the content
var content = document.getElementById("content");
// hide by default
content.style.display = "none";
@renemorozowich
renemorozowich / style.css
Created June 20, 2019 13:35
Basic media query
/* mobile first */
h1 {
color: #ff0000; /* red */
}
/* tablet */
@media only screen and (min-width: 768px) {
h1 {
color: #ffff00; /* yellow */
}
@renemorozowich
renemorozowich / style.css
Created June 20, 2019 02:10
Basic style.css file
html {
padding: 5%;
}
body {
font-family: 'Montserrat', sans-serif;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Playfair Display', serif;
@renemorozowich
renemorozowich / index.html
Last active June 20, 2019 14:07
Basic index.html file with additional features
<!DOCTYPE html>
<html>
<head>
<title>My Favorite Outdoor Summer Activities</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat|Playfair+Display&display=swap" rel="stylesheet">
</head>
<body>
@renemorozowich
renemorozowich / index.html
Created June 20, 2019 01:50
Basic index.html file
<!DOCTYPE html>
<html>
<head>
<title>Page Title in Browser Tab</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is my first web page!</p>
@renemorozowich
renemorozowich / style.css
Last active May 25, 2019 21:18
Style a top menu added to an Astra child theme
.top-header-bar {
background-color: #ff0000;
text-align: right;
padding: 10px 0;
}
#menu-top {
margin: 0;
}
@renemorozowich
renemorozowich / functions.php
Last active May 25, 2019 21:17
Add a top menu to an Astra child theme
/**
* Add additional menu
*/
function register_additional_menus() {
register_nav_menu( 'top-menu', __( 'Top Menu' ) );
}
add_action( 'init', 'register_additional_menus' );
/**
* Add scripts to astra_header_before