Categories
Microsoft Windows Web Applications & Online Software

Office.com Office 365 Creating Shared Mailboxes by the Same Name under Different Domains

When you have multiple domains under the same Office 365 admin account, e.g. domain1.com, domain2.com, etc., you can’t directly create these emails:

  • support@domain1.com
  • support@domain2.com

Which would give this error when you try to create emails by the same name already used by another domain:

Now you can have a little circumvention to get around this by first creating the email with a unique local name and then creating an email alias to use the name you want.

Do as the following:

Done!

Categories
WordPress How To

Add SSL / HTTPS for WordPress Network sub-site as cPanel Alias Domain

Site Address (URL)

We first change the Site Address (URL) of the sub-site.

Go to WordPress Multi-site: “My Sites” => “Network Admin” => “Sites” => Click “Edit” of the sub-site, and change the Site Address (URL) to the top level domain URL like this:

https://www.example.com/

Click “Save Changes“.

Domain Mapping (plugin)

A top-level domain is added to WordPress Network / Multi-sites via the Domain Mapping plugin. Add these top-level domains:

  • https://example.com
  • https://www.example.com (Primary)
  • https://www.example.com

However since the domain is not in the cPanel as an addon domain, AutoSSL will not issue SSL certificate for it.

cPanel Alias Domain + AutoSSL

The solution is, after adding the top-level domain in the Domain Mapping plugin, add it in cPanel as an Alias Domain for the WordPress Multi-site main domain (independent cPanel account).

Therefore AutoSSL will issue and install an SSL certificate for the alias domain. Go to “Manage AutoSSL” in WHM and “Run AutoSSL For All Users” to manually request SSL certificate for the alias domain.

It may take some minutes for the new certificate to be installed.

Really Simple SSL (plugin)

Now install the Really Simple SSL plugin, network activate it, and choose per site mode.

Go to the sub-site dashboard: “Settings” => “SSL” => Activate SSL

Done!

Optional .htaccess config

If you haven’t done the above step, below is optional and NOT required at all, otherwise below is required.

You can force HTTPS on the top-level domain in .htaccess of your WordPress network installation:

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} yourtopleveldomain\.com
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . index.php [L]

Categories
Web Applications & Online Software

You don’t need a Google Apps alternative for email hosting

Now that Google Apps closed sign-up for free plans, lots of people are looking for alternatives to Gmail for their own domains. Actually they don’t need to.

You can simply add other domains to your existing Google Apps account as separate domains to set up emails such as [email protected]. The separate domain emails perform exactly like those of the primary domain, with all the good stuff of Gmail, except you can’t do these things with a separate domain.

To add a separate domain to your existing Google Apps account, just login in the admin console and click “Domains” (click “More controls” if not visible) => click “Add a domain or a domain alias” => select “Add another domain” => enter the domain name => “Continue and verify domain ownership”.

After the routines of verifying ownership and setting up MX records, you can go ahead and add users / emails to the separate domain.

In most cases, you don’t need to find a Google Apps alternative this way, unless you hit the maximum number of users per account.

Categories
Web Design Tips and Insights WordPress How To

Theme Van Premium Portofolio WordPress Theme by My Friend Johnny

My friend Johnny is a very talented web designer. He’s recently released a portfolio WordPress theme at ThemeForest which is very classy and cutting-edge in styles.

SimpleKey

Be sure to also check out some of his other work at the ThemeForest page and his design studio ThemeVan.

Categories
WordPress How To

Customize WordPress Admin Styles from Your Theme Directory

It’s better to style the /wp-admin of WordPress from your theme because it’s portable and upgrade-proof. Keeping all customizations  in ONE place is always a good idea in web development.

How to style WordPress admin backend /wp-admin from your theme?

  1. Add this hook to the functions.php of your theme:
    function customAdmin() {
        ?><link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/wp-admin.css" /><?php
    }
    add_action('admin_head', 'customAdmin');

    Which effectively adds a stylesheet to the header of every /wp-admin page.

  2. Create a text file named wp-admin.css in your theme directory.
  3. Write the customization styles in wp-admin.css.

That’s it. Now you can freely customize the look and appearance of the WordPress admin backend from within wp-admin.css in your theme directory.

Categories
WordPress How To

Make WordPress Hooked Function to Run Only Once

Consider this hook to add something before your WordPress blog’s sidebar:

function before_siderbar() {
?>
<!-- Something goes here, such as an AdSense links unit -->
<?php
}
add_action( 'get_sidebar', 'before_siderbar' );

It’s usual to add an AdSense links unit there but the problem with some themes is that they run get_sidebar more than once, such as on the sidebar AND in the footer. Consequently, you would end up with multiple AdSense links unit here and there, whereas you only wanted it on the sidebar once.

This could create a TOS problem towards AdSense because unconsciously, you would very probably end up adding more than 3 links unit per page.

To prevent this and only make the hooked WordPress function to run once (even it is called multiple times), use the PHP static variable in functions.

function before_siderbar() {
	static $called = false;
	if (isset($called) && $called) {
		return false;
	}
?>
<!-- Something goes here, such as an AdSense links unit -->
<?php
	$called = true;
}
add_action( 'get_sidebar', 'before_siderbar' );

In the above snippet, the variable $called is kept alive across multiple calls to the before_siderbar() function. After the first successful run of the function, $called would have a value of true and it’s kept so inside the function every time it’s called afterwards. In the 2nd and every call afterwards, $called will always be true and the function returns before outputting the AdSense code.

There you go. Now no matter how many times the before_sidebar() is called, only the first run would output the stuff you put in it.

Categories
Make Money Online vBulletin Tips

vBulletin: Paid Subscription Not Showing Up

I was trying to start a premium membership for Kavoir Backyard and after I have created a Paid Subscription profile, nothing shows up in user control panel nor at /backyard/payments.php.

As you can see from the thread I started in the official vBulletin forum for help, I have done everything necessary to create the subscription profile and it’s definitely active. But somehow, it simply doesn’t show up at all.

Subscription Manager

Paid Subscription profile

I see no “Paid Subscription” link in user control panel left sidebar nor any subscription order forms. The payments.php page says “Kavoir Backyard Webmaster Forum does not have any paid subscriptions available to which you can subscribe.”.

What’s wrong? What did I leave out? The solution!

Turned out it’s because I didn’t specify the payment details for Paid Subscriptions. You should use Payment API Manager to specify the payment API: Paid Subscriptions –> Payment API Manager.

paid subscription payment API

By default there’s NO active payment API and you have to explicitly select one such as PayPal and enter the details. Once it’s all configured and active, Paid Subscriptions link and premium membership order forms are correctly displayed to the registered users in the control panel.

Disappeared again after upgrade?

After upgrade, the paid subscription is disappearing again. To make it show up, just de-activate the payment method in Payment API Manager and re-activate it again by first setting Active to No and then back to Yes again (click Update twice).

Weird how things work in the world, huh.

Categories
HTTP Tips & Tutorials Information Security Internet Tools Web Applications & Online Software

Make Firefox to Not Send HTTP Referer (or On a Per-Site Basis)

By default browsers such as Firefox sends the Referer information to the target URL in the HTTP header, as defined by HTTP protocol, so the destination URL / website knows where you have come from. For instance, when you click this link to one of my friends’ sites, it would know you have arrived at Princessly from this page:

https://www.kavoir.com/2012/08/make-firefox-to-not-send-http-referer-or-on-a-per-site-basis.html

Because Firefox sends this information in the HTTP header.

While this is very valuable data to many parties, such as the website owners (who can analyze traffic sources) and market analysts (who wants to know people’s interests and habits so as to sell well), it can be bad for our privacy because it is disclosing our browsing information to the websites we are visiting. You may want to disable Firefox from sending the referrer.

How to disable Firefox to send HTTP referrer?

Just type:

about:config

In your Firefox address bar and click “I’ll be careful, I promise!”.

In search, type:

referer

And an entry reading “network.http.sendRefererHeader” would come out with a value that’s 2 by default. Right click on the entry and click “Modify”. Input 0 and click OK.

Restart your Firefox, and now it should not send any referer information any more. And no website would ever know where you were before coming to them.

Not Send Referer on a Per-Site Basis in Firefox?

However, sometimes this may break something as legitimate sites are also using referer information to better serve you. There must be some sites that you don’t quite trust and wanted to disable referer for them.

Simple. Just use the RefControl add-on for Firefox.

After installation, you should see a tiny button on the Add-on Bar, at the bottom of the Firefox window. When you are at the website, click on the button and select “RefControl Options for This Site” and you will have this dialog box:

block referer in Firefox

Just select your intended option for this particular site. If you do not want to send any referer information to this site, just select “Block – send no referrer” and click OK.

That’s it. Now Firefox will send no HTTP referer information to this particular site but will keep sending it to all other sites.

Categories
Content / SEO Tips & Tutorials Make Money Online WordPress How To

How to Create WordPress Widget Areas (Before and After Single Post)

Most WordPress themes such as those released by WooThemes come with ready to use widget areas only in sidebar and footer. They are missing out the most important areas of a blog for readership attention and actionable conversions. They are the areas immediately before single post content and immediately after it.

For example, a paragraph naturally flowing at the end of the post as if it’s part of the content would definitely grab the attention of your readers:

immediately after single post content

So How do We Create These 2 New Widget Areas?

Open functions.php and put in the follow snippet:

// This registers the widget area immediately before single post content
register_sidebar(array(
    'id' => 'before-single-post',
    'name' => 'Before Single Post',
    'description' => 'Widget area immediately before single post content',
    'before_widget' => '<div id="%1$s">',
    'after_widget' => '</div>',
    'before_title' => '<h2>',
    'after_title' => '</h2>'
));

// This registers the widget area immediately after single post content
register_sidebar(array(
    'id' => 'after-single-post',
    'name' => 'After Single Post',
    'description' => 'Widget area immediately after single post content',
    'before_widget' => '<div id="%1$s">',
    'after_widget' => '</div>',
    'before_title' => '<h2>',
    'after_title' => '</h2>'
));

And then open single.php or content-single.php or whatever it is that is the single post template file of your theme. Find the_content() and put before and after it the dynamic_sidebar() function so the widget content is displayed. You will very probably have something like this in the end:

<div id="before-single-post">
	<?php dynamic_sidebar('before-single-post'); ?>
</div>

<?php the_content(); ?>

<div id="after-single-post">
	<?php dynamic_sidebar('after-single-post'); ?>
</div>

Done.

Only 2 files (functions.php to register the widget area and one other file where you intend the widget content to be displayed) that need to be edited and updated to add new widget areas.

Adding Stuff to the Widget Areas

Now if you go to Appearance –> Widgets in the WordPress backend console, you would see 2 extra widgetized areas:

widget areas created

Try adding a widget there (probably the text widget) and see how it looks so you can style it for better attention attraction.

Categories
WordPress How To

Create a WordPress Child Theme

WordPress amazes by making things possible in the simplest and most intuitive way. Child themes are the intended and correct way for customizing a third-party theme and you should always create a child theme to do the customizations so that the original theme stays intact thus ready for upgrade. And this is how you can do it with a file that’s just a few lines.

Follow the steps. Create the child theme folder and its style.css.

How to create a WordPress child theme?

  1. Create a folder in /wp-content/themes and name it however you like as this would be your child theme directory. For instance, you are creating a child theme from Twenty Eleven, and you may name it twentyeleven_one, twentyeleven_two, or something.
  2. Create a style.css file in the new directory and put in the following lines in it:
    /*
    Theme Name:     Twenty Eleven Child One
    Template:       twentyeleven
    */
    
    @import url("../twentyeleven/style.css");
    
  3. That’s it. Now head to Appearances -> Themes and refresh the page to see the new theme that you can activate.

The bold part of the above code is the folder name of the parent theme, so this child theme knows which parent theme it is inheriting from.

Activating Child Theme & Customizations

After you have activated the child theme, everything will be the same as if you have activated the parent theme. And you can overrule the same file in the parent theme by creating an identically named file in the child theme, including .php, .css, .js, .jpg, etc. Note however, you can’t overrule files in a sub-folder of the parent theme.

For example, you can now write some CSS styles in the style.css you just created and it will be overwriting existing styles in style.css in the parent theme directory.

Any customizations to the theme files will be only in the child theme so the parent theme will be free and ready to be upgraded thus preserving your changes.