WP Query Show Post Count when Paginating results

# WP Query Show Post Count when Paginating results Let’s say that you doing a custom query, and their is pagination in place, and you want to show : “Displaying 2 out of 5 results” (2 results on this page, and you have 5 total in all of the pages). The way to do …


Git – Remove Unsaved Changes

To remove all changes you made  and “reset” to the last commit # Revert changes to modified files. git reset –hard # Remove all untracked files and directories. (`-f` is `force`, `-d` is `remove directories`) git clean -fd


WordPress – Create a Custom User Role (and Delete a Role)

# WordPress – Create a custom user role Sometimes you want to create a special user with a special name and behavior inside WordPress The way to add a custom user role is the following: function add_capability() { // Add a custom user role (1) – Let’s say… God! $result = add_role( ‘god’, __(‘God’), …


JavaScript – On Document Ready (Snippet)

# JavaScript – On document ready (Snippet) Common use is let’s say you want to change color to an element to red, but when you run it you get a console error telling you that the element doesn’t exist, depending on your code structure, it is possible that this code is running before that …