Elementor Notes

For issues where the buttons don’t align, the CSS provided below can fix it either using Flexbox or Grid depending on how many items are in the container.

Make hero image full screen under header

MySQL Notes

Notes for a refresher and or quick reference for SQL.

JOIN chart for visualizing the different types of possible JOIN. Source: https://www.w3schools.com/sql/sql_join.asp

Source from below: https://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins

For a INNER JOIN , it can be re-written as such below and is called an IMPLICIT INNER JOIN

There is no difference between RIGHT JOIN and RIGHT OUTER JOIN. Both are the same. LEFT JOIN and LEFT OUTER JOIN are also the same.

IFNULL function. If it is going to return a NULL value you can set a replacement value instead. Useful for LEFT/RIGHT JOINS where a column maybe be NULL

So for example:

Vuejs notes

Mass registering global components

Import top level components and export them as an Array:

Then in main.js we loop through the components and register them globally:

 

Useful Vuejs libraries

https://cdn.jsdelivr.net/npm/v-mask/dist/v-mask.min.js  can be used for phone and zip code masks to prevent bad input. Also works with Element UI. Just include via cdn and then can be used as a directive i.e. :

 

Vuex Notes

Example Vuex with some comment notes

In main.js we add the store via:

In a component that uses something in the store:

Mutations are for non-async updates to the Vuex store. Actions can use async code. Generally, should actions should always be used instead of Mutators.

If using Mutators.. the update to the store can happen directly. i.e. this.$store.commit('mutatorMethodThatUpdatesStore');

Actions use dispatch instead: this.$store.dispatch('mutatorMethodThatUpdatesStore');

3 useful methods from Vuex are:

mapGetters

mapMutations

mapActions

mapState – mapState should be used instead of creating “dummy” getters. Dummy getters are ones that simply just return the store’s state value.

Getters should be more used for computed type values or for things such as a filter etc.

For each of the 4 above..All have either an array of strings of names of state/getter/mutation/action or can pass in an object with key/value pairs if needing a different name. For example:

WordPress – Making a custom type not have a url

Custom post type should have below settings:

‘rewrite’ => false,
‘query_var’ => false,
‘publicly_queryable’ => false,
‘public’ => false

Explanation of each:

rewrite Triggers the handling of rewrites for this post type. To prevent rewrites, set to false.

query_var ‘false’ – Disables query_var key use. A post type cannot be loaded at /?{query_var}={single_post_slug}

publicly_queryable Whether queries can be performed on the front end as part of parse_request().

public ‘false’ – Post type is not intended to be used publicly and should generally be unavailable in wp-admin and on the front end unless explicitly planned for elsewhere.

Go to Permalinks Settings and without changing anything – save change. It will rebuild your “routing”.

Source: https://stackoverflow.com/questions/19747096/remove-url-structure-for-custom-post-type