Archives: Tutorials

What is .gitignore and how to use it?

Gitignore is a file in a Git repository that tells Git which files or directories to ignore when committing changes. Ignoring certain files and directories can be useful when you have files that are generated automatically or are specific to your local development environment and you don’t want to commit them to the repository. To […]

Read more

Force HTTPS using .htaccess

Add the following script to your .htaccess file RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]  

Read more

Simple Bash Script to easily GIT Commit + Push

@echo off REM Ask generic changes set /p changes=”Enter Changes: ” git add . && git commit -m “%changes%” && git push origin master  

Read more

Proper way to handle GET and POST request in WordPress

<?php add_action(‘init’,’handle_your_reqest’); function handle_your_request(){ if (isset($_REQUEST[‘your-key’])): // Your Code Here exit; endif; }  

Read more

WordPress Ajax: The Easy Way

This is a simple guide to implement an AJAX to your WordPress site. Quick Summary: Register your Javascript file to WordPress and localize your AJAX admin URL. Setup simple jQuery script to send post to admin URL. We also need setup the action function to handle the request. 1) Register your Javascript file to WordPress […]

Read more

Bootstrap 4 Pagination for WordPress

Copy wordpress-bootstrap-4-pagination.php from https://github.com/renzramos/wordpress-bootstrap-4-pagination Add boostrap_4_pagination() to your archive page. It’s also supported bootstrap 5 (https://getbootstrap.com/docs/5.0/components/pagination/)  

Read more

Create Custom Post Type for WordPress

Add this to your theme functions.php function theme_slug_register_post_type() { $labels = array( ‘name’ => _x( ‘Referrals’, ‘post type general name’, ‘theme-slug’ ), ‘singular_name’ => _x( ‘Referral’, ‘post type singular name’, ‘theme-slug’ ), ‘menu_name’ => _x( ‘Referrals’, ‘admin menu’, ‘theme-slug’ ), ‘name_admin_bar’ => _x( ‘Referral’, ‘add new on admin bar’, ‘theme-slug’ ), ‘add_new’ => _x( ‘Add […]

Read more