Skip to content

Instantly share code, notes, and snippets.

@yCodeTech
yCodeTech / setup_wp_custom_post_types_and_taxonmies.md
Last active May 23, 2024 13:52
Setup WP Custom Post Types and Taxonomies

Setup WP Custom Post Types and Taxonomies

Install CPT UI.

Adding new Custom Post Types (CPT UI)

Under the CPT UI, click Add/Edit Post Types.

  1. Post Type Slug = singular lowercased name eg. product
  2. Plural Label = plural first-letter capitalised eg. Products

A mousemove utility to get the x coordinate of an element or the window. Coordinates are left-based, but we might want to get the x coordinates originating from the right instead. To do this we need to do a bit of maths.

This little function utility (using jQuery) logs to the console the x-left and x-right coordinates.

Example on Codepen.

function mouseXCoords(element) {
	var obj = {