Author: admin

Example of Creating Basic Factory and Service in AngularJS

[code] mainApp2.factory(‘MathService’, function() { var factory = {}; factory.multiply = function(a, b) { return a * b; }; return factory; }); mainApp2.service(‘CalcService’, function(MathServic){ this.square = function(a) { return MathService.multiply(a,a); }; }); mainApp2.controller(‘CalcController’, function($scope, CalcService)...

How to Install Sass in Windows

Since I was in introduced to using Sass, I never want to go back to the traditional way of coding stylesheets. Here are the steps to starting using Sass:   Sample Command

How to Add Category Options for Custom Post Types

Adding category options for your custom post type is so easy. If you want your custom posts and the default posts to share the same categories, simply insert the ff. line of code below:...

How to Style WP Nav Menu

If you’re creating your own theme and use adding a menu using the standard WordPress function wp_nav_menu(), you will have to style it using CSS in order to make it like the usual navigation...

How to Create a Tab

Jquery has already made a tab function that’s very easy to use. But if you have problem using such function and you’re considering of other function to achieve the same output, you can try...

Calling Ajax in WordPress

There are so many ways to call ajax in WordPress, but below is how I do it. 🙂 Add the following functions in PHP file. [insert-code id=1] Add the following functions in JS file....

Display PHP Errors

The following code snippet will show php errors and warnings if there is any. [insert-code id=1]

Plugin Class

Since I know that I will be making more plugins for the rest of my life, I decided to create a class that does the basic task that most of my plugins need, namely:...