In an older post we talked about getting the previous page URL with a backspace event. However, for some people using older versions of Chrome or Safari, this would cause the page to constantly refresh due to Chrome or Safari’s browser emitting a
onPopState event on page load. Here’s how to solve the issue for onPopState on Chrome and Safari.
For this tutorial, we will be using
window.onPopState to detect the back / forward button navigation for the browser, and
location.pathname to get the path.
Adding a WordPress post title is quite simple, but if you’re just starting into developing your own WordPress based website, their documentation might be a bit confusing as it is introduced part by part to you. This post will serve to bridge the gap between the functions you need to use to add a wordpress post title link in your site so you are able to direct your users into the single post on your desired page.View Article
If you’re using WordPress as a CMS, you’ll see that you only have one menu to work with and it only appears on the header navigation area. However, you will eventually want to know how to create a custom menu to add into certain sections of your site, in which this following tutorial will show you how.
WordPress provides a step-by-step approach to creating your custom WordPress menus. You will have to register your custom menus first, then link and add your menus onto the frontend. There are also two ways of registering your custom menu with
register_nav_menus. I like to use
register_nav_menus because of it’s convenience of adding multiple menus via an array, so this will cover only just that.
For those obsessed with allowing the browser and any potential web crawlers to correctly understand what your code means, this is pretty important — which is semantically correct?View Article
Wondering how do you select odd and even elements with CSS selectors? It’s pretty easy, given that there are a few different ways that you could utilize CSS pseudo class selectors to selectively style your code.
If you’re using
nth-of-type(), there are 2 ways to select the odd or even elements in a parent element.