For a secured system, most of the data is encrypted in server end and sent to database. And after fetching the data from database, just decrypt before showing in front end. There are lots of procedure to encrypt the data, lots of encryption algorithm out there. But, here we will use a simple encryption method… Continue reading Easiest but powerful encryption in PHP
Category: PHP
How to use custom post type archive as front page
We can easily set any page as front page from Settings > Reading. It can be any static page. But what if we want to set an archive or CPT archive page as front page? There are many ways to do so. We can create a custom page template, and write our code to get… Continue reading How to use custom post type archive as front page
How to convert hexadecimal color value to RGB value in php
Most of the CMS provides a color picker in admin panel to user to choose a color. And almost all of the color pickers return the color code as hexadecimal mode, e.g. #4EE4D3. So, you can just get the value and set the color in css. For example: [php] body{ background: } [/php] This is… Continue reading How to convert hexadecimal color value to RGB value in php
Get current page url in php
In an application, sometimes we need to get the current page URL in php. I mean, the URL shown in the browser. Here is how you can do it. First, we will declare and use the function as the following: https://gist.github.com/bappi-d-great/bc4037a4896f0dd233e6 Hope you will like it
How to write dynamic css in a php file in wordpress
It’s always standard to maintain a separate css file for styling, even for dynamic css that is generated by the theme options. Most of the theme developers include this dynamic styles into the header or footer using wp_head or wp_footer hook. How’s about having a totally separate css file for the dynamic styles? It’s pretty… Continue reading How to write dynamic css in a php file in wordpress
How to load a wordpress plugin at very last
You need to load your plugin at vert last? Well, sometimes we develop a simple plugin that is dependent to other plugins, something like add-on. So, in those cases, the addon plugins need to be loaded after the parent plugin. Here is a small snippet that need to put at the addon plugin to make… Continue reading How to load a wordpress plugin at very last
Limit one blog per user in a wordpress multisite
In a wordpress multisite, an user can create as many blog as he wants. If you Pro Sites you can control this. Pro Sites is a giant plugin that will help you to have control over the whole network. But if you just want to limit one blog per user in a wordpress multisite and… Continue reading Limit one blog per user in a wordpress multisite
Easily display member cards with WPMU DEV Membership
Here’s a simple shortcode snippet to let you easily add a membership card for your site’s members when using WPMU DEV’s Membership plugin. This was requested in the WPMU DEV forums, where we love to help members out with simple and useful custom snippets. WPMU DEV Forum topic: Display Membership Data Print/Mobile The snippet adds a… Continue reading Easily display member cards with WPMU DEV Membership
How to enable php mail() in your ubuntu
In my last post I showed you how you can set up an ubuntu server for apache, php, mysql, phpmyadmin and wordpress multiste. Below is the link if you want to take a look: How to setup a VPS (Ubuntu) for WordPress hosting – A to Z tutorial Today, we will learn how we can… Continue reading How to enable php mail() in your ubuntu
How to hide a plugin for non-admin users in wordpress
Today I will show how you can hide a plugin from the users that are non-admin. If you use a multisite, you can control a lots of stuffs with Pro Sites plugin. But what if you don’t want to use Pro Sites? This simple scripts will do the job for you. [php] function custom_plugins( $plugins… Continue reading How to hide a plugin for non-admin users in wordpress