WordPress How To

How to replace a string in all posts in WordPress database?

We had some anomalies in our WordPress sites that some of them old posts have the wrong interpretation of single quotes and double quotes so we had to manually replace all the wrong strings to the correct quotes. In cpanel, you can open up phpmyadmin to run the following MySQL queries, but first, you need …

How to replace a string in all posts in WordPress database? Read More »

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 …

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

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? 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" …

Customize WordPress Admin Styles from Your Theme Directory Read More »

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, …

Make WordPress Hooked Function to Run Only Once Read More »

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 …

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

PHP preg_match() First Letter of a WordPress Post for Drop Cap Styling

While CSS3 can target the first letter of text inside an element, it’s still not universally supported across major browsers AND it doesn’t work well for elements that have child elements inside. The bullet proof way to target the first letter of a WordPress post would be to capture the content of the post in …

PHP preg_match() First Letter of a WordPress Post for Drop Cap Styling Read More »

WordPress: Programmatically Add Items to a Menu (Dynamically)

Menus are created and edited from in the WordPress backend and then called in frontend theme to be displayed by the wp_nav_menu() function. On some occasions, we may want to programmatically add one or two menu items to a menu because those menu items change frequently and it would be a chore to have to …

WordPress: Programmatically Add Items to a Menu (Dynamically) Read More »

Customize WordPress Login Header and Link, Upgrade-proof without Plugin

The default image header and link on the login / register page of WordPress is a WordPress one, apparently, but when you are enabling registration / login to general users, you would want to use your own logo and website URL as the header rather than the default -  so people don’t get confused and …

Customize WordPress Login Header and Link, Upgrade-proof without Plugin Read More »

WordPress: Display Ads in Post Content and Only Display Ads in Old Posts

The title pretty much says it all. It’s 2 of the most useful AdSense ads tips for bloggers in my opinion. Obtrusive ads have the unnecessary effect of driving away readers after they have found what they needed. Unless you have amazingly great content, the chance of them becoming a loyal reader is rather low …

WordPress: Display Ads in Post Content and Only Display Ads in Old Posts Read More »

Redirect 404 Error to Home Page

Other than making your 404 error page user friendly, you can redirect it to your index pages such as the homepage, sitemap, or search page, to make it useful for the users. Instead of relying on them to correct the error themselves, you offer the new orientation. How to redirect a 404 error page to …

Redirect 404 Error to Home Page Read More »

Thesis Theme Review – Don’t just create good products but irresistable ones.

Merely good product is far from enough. To rake in profits in the magnitude vast majority of us can only dream of, you need an irresistible product – just like Thesis Theme. Think of something you’ve purchased that’s been insanely useful, beautiful and user friendly and then double it. iPhone has proved it all. It converts massive numbers …

Thesis Theme Review – Don’t just create good products but irresistable ones. Read More »

WordPress blog goes blank after editing and updating the theme files

Really weird but not unexpected at all. After trying to edit and update a theme file functions.php to override a native function of WordPress, get_search_form, inserting these lines at the end of functions.php of my theme: function get_search_form() { ?>test<?php } To see if the native get_search_form() function can be overriden. Turns out it can’t. …

WordPress blog goes blank after editing and updating the theme files Read More »

Best Damn Premium WordPress Theme for Professional Blogs: THESIS

Imagine the best WordPress theme you have ever used and then triple the pleasure you enjoyed with it – that’s what Thesis can give you. Whatever your niche is, if you are ever after a powerful, beautiful WordPress premium theme well balanced between functionality and customizability with best support from the author, this is the …

Best Damn Premium WordPress Theme for Professional Blogs: THESIS Read More »

How to Transfer / Move WordPress Blog from One Domain to Another

Basically, the root URL of your blog which is your domain or subdomain is changing here. Though this doesn’t seem like a sane decision considering the huge SEO impact that might fall upon your site but with HTTP 301 permanent redirection, this can still make sense in some situations. Assume you won’t change the details …

How to Transfer / Move WordPress Blog from One Domain to Another Read More »

MySQL: String Function to Replace Substring and Change Part of the Field Value

A typical case of replacing a part of the string to another substring in a database table is switching between site domains or URLs, such as when you want to transfer your WordPress blog from one domain to another. You have to change all values containing the original site URL to the new one in …

MySQL: String Function to Replace Substring and Change Part of the Field Value Read More »

WordPress: 503 Service Temporarily Unavailable when Posting New Posts or Modifying Existing Posts

It’s weird that I encountered this problem that when you post new posts in WordPress, there’s a possibility that it may run into a 503 Service Temporarily Unavailable error without publishing the article at all. I did some split tests and in this post, the string ‘fopen‘ which is a php function seems to be …

WordPress: 503 Service Temporarily Unavailable when Posting New Posts or Modifying Existing Posts Read More »