Category Archives: PHP

Creating WordPress Multisite Network

    • Install WordPress
    • Add the following line just above /* That’s all, stop editing! Happy blogging. */
    • define(‘WP_ALLOW_MULTISITE’, true);
    • Last step enables the Network Setup item in your Tools menu.
    • Go to Dashboard => Tools => Network Setup.
    • Do as directed. It will ask you to choose from the following two network options:
  • Sub-domains — a sub-domain based network in which sub-sites use subdomains. Example: http://lamp.sangkrit.net
  • Sub-directories — a path-based network in which sub-sites use directory path. Example: https://sangkrit.net/lamp
    • If you choose sub-domain network option then you will need to generate wild card from your c-panel check this tutorial: Subdomain Network: Adding A Wild-Card DNS In DNS Server
    • Network details get filled in automatically but you are free to make changes:
  • Server Address: The domain of the URL to access your WordPress installation.
  • Network Title: The title of your multisite network.
  • Admin E-mail:  Super admin’s email address for whole network.
  • Click the Install button.
  • Follow on screen instructions.  It provides you with cold blocks to add on your site’s wp-config.php and .htaccess files and prompts you to create a directory:
  • Create a directory for media file uploads. Directory should be writable by webserver.
  • Add the specified lines to your wp-config.php file
  • Add the specified lines to your .htaccess file
    If you do not have a .htaccess file, then create it in root directory.
  • Clear your browser’s cache and login to your site.
  • From your Dashboard at the top left corner you will see My Sites menu. Now you may visit your Network Administration from My Sites => Network Admin => Dashboard.

Migrating Multiple Blogs To WordPress Multisite

  • Export content of your existing WordPress installations from Dashboard=> Tools=> Export
  • Install WordPress
  • Activate Multisite by adding define(‘WP_ALLOW_MULTISITE’, true); in your wp-config.php
  • Open Dashboard of your new WordPress installation.
  • Open Tool=> Network Setup from Dashboard and do as directed.
  • Create blog for each site you like to import.
  • Import each site’s content you exported from old installations from Dashboard=> Tools=> Import
  • Install all themes and plugins of your old site if you like and network activate them.
  • If your old installations have their own domain names then Map domains to your main site using MU Domain Mapping

Embedding RSS Feed In Your WordPress Posts And Pages

Open Your themes function.php and add the following code at the bottom:

include_once(ABSPATH.WPINC.’/rss.php’);

function readRss($atts) {
extract(shortcode_atts(array(
“feed” => ‘http://‘,
“num” => ‘1’,
), $atts));

return wp_rss($feed, $num);
}

add_shortcode(‘rss’, ‘readRss’);

Save function.php and whenever you need to embed RSS in any of your post or page write the following short code inside your post:

[ rss feed=”https://sangkrit.net/feed” num=”5″ ]

In the above give short code replace https://sangkrit.net/feed with your feed address and in num=5 replace 5 with the number of posts you like to show.

Note: Remember there is no space between [ and rss feed and num=”5″  and  so after you copy the short code; check the space, remove it (if there is some space) and then publish it.

One Command LAMP Server Installation

Installing LAMP Server

  • Open your Linux Terminal.
  • Type: sudo apt-get install lamp-server^
  • Press Enter

Checking the Installation

  • Open a web browser
  • Type: http://localhost/
  • If your browser shows the message: “It Works” then you have successfully installed LAMP

Tasksel Method

Other than the above given method you may use the Tasksel method for installing LAMP server. Use following given commands on your Linux Terminal:

sudo apt-get install tasksel
sudo tasksel install lamp-server

PhpMyAdmin

If you need to install PhpMyAdmin for managing your website’s database:

sudo apt-get install phpmyadmin

How Automattic Makes Money

WordPress is Free, Opensource and Priceless software from Automattic used for creating website, blog or something like that. You can download WordPress from www.wordpress.org for free.

But you know how Automattic makes money as it gives everything for free. No, it don’t give everything for free but yes most of its applications and the core software WordPress is absolute free for you.

Now lets see how WordPress makes money:-

VIP Hosting

WordPress provides VIP Hosting for major brands like Time Magazine, NewYork Times, CNNBoing Boing and also TechCrunch etc. To know more brands hosted on WordPress VIP Hosting CLICK HERE

WordPress offers you two types of VIP hosting:-

Akismet Anti-Spam Technology

Akismet is an automated spam killer used by millions of blogs. Using this you don’t need to spend long time on deleting spam. WordPress makes money through Akismet as it offers different plans to bloggers for use Akismet.

For using Akismet you have to signup by choosing one of the following plans to get an API key:

  • Enterprise: Costs $50/month. Here you get multiple site access. It is good for companies having low web traffic.
  • Pro: Costs $5/month. It gives single site access. Good for small non-personal sites and blogs.
  • Personal:  Costs $0 to $120/year. Good for non-business personal blogs.
  • High Volume: Companies with or over 100k calls per month pays per call. Costs $100/month minute.

Premium Features

These are the optional priced per year upgrades offered by WordPress:

  • Be the master of your domain: Costs: $13.00 – $25.00/year. For controlling your online identity you may add your own domain name. Like www.example.com instead of www.example.wordpress.com This feature can be added to you existing WordPress blog.
  • Extra Storage: Costs $20.00 – $290.00/year. This is used by the bloggers whose content is running out of space.
  • Custom Design: Costs $30.00/year. Bloggers use this to customize blog’s fonts with a point-and-click interface. No coding required.
  • VideoPress: Costs: $60.00/year. Uploads your videos, get them converted into different formats including HD etc. Including many more features.
  • Go Ad-Free: Costs $30.00/year. Time to Time WordPress displays Ads on your blog for logged out users. You may turn off the Ads by using this feature.
  • Guided Transfer: Costs $129.00 . This feature is used for transferring a WordPress site.
  • Premium Themes: You may upgrade to premium WP Themes for adding more options to site customization. Pricing for each theme is displayed under the theme on your dashboard.

Google AdSense 

This is what most of us use to make money online by putting Google Adsense on our web content. This is a free program by Google that empowers online publishers to earn revenue by displaying some Ads on their content. As I had already told you that time to time WordPress displays Ads on your blog for logged out users, this is what Google Adsense.

Support Networks

If support forums aren’t enough to solve your problem then you may switch to support networks.

VaultPress

This is WordPress’s security, backup and support. It backup you blog automatically without any security flaw.

Plans and Pricing follows:

  • Basic: Costs $15/Month per site. Gives realtime backup and automatic restore during disaster.
  • Premium: Costs $40/Month per site. Gives back-up restore and continuous security scan.
  • Enterprise: Costs $350/Month per site. Gives solutions for large scale WordPress Installations.

Poll Daddy

This is Online Survey Software with both free and paid plans as follows:

  • Free: This is absolute free for ever not a trial or something like that.
  • Professional: Costs $200/Year.
  • Corporate: Costs $899/Year