Easily fix WordPress URL after a migration

Building WordPress on a different URl or in a subfolder is common practice for many. Most people will do it because they don’t want the website to be accessible to the general public until everything is ready.

When it comes time to migrate the WordPress site to the domain’s root or a different domain name, it’s easy to break things.

The most common problems people get are:
– Admin login redirect.
– Links redirect if using absolute path.
– In the worse case a blank screen.
– etc…

Fortunately, it’s very easy to prevent the above problems.

First, if you use a folder within the main domain you would like to keep the WordPress web site on, it will be an additional security strength to keep your installation there. I know you actually want your web site to be directly accessible. You want visitors to type something like “domain.dlt” instead of “domain.tld/some-folder-name”.

You can get people to access the WordPress content directly by making the following update to a copy of your index.php from the installation’s root and paste it in the domain’s root:

require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
require( dirname( __FILE__ ) . ‘/some-folder-name/wp-blog-header.php’ );

“some-folder-name” will be the name of your installation folder.
However, you will have to keep the same login URL like before and that will be another guess a hacker will have to make before guessing the username and password.

Second, if you are moving to a different URL, you have to make an update in your wp-config.php.

Open wp-config.php and just above the line “/* That’s all, stop editing! Happy blogging. */”, place the following lines of code and replace “newURL” with your new domain name.

define(‘WP_HOME’, ‘http://newULR’); // site URL
define(‘WP_SITEURL’, ‘http://newURL’); // installation URL

If you decide to have your WordPress installation into a folder like in the first option, you will need to update the second line above into the following:

define(‘WP_SITEURL’, ‘http://newURL/some-folder-name’); // installation URL

keeping in mind “some-folder-name” will be your actual folder name.

It’s true it will be fairly simple to update your database, but it’s also very easy to break things there.

Before making any update please make a backup of your WordPress site (files and database).

Read this wizdom and more like it here

Two must-know Python libraries


When working with dictionaries you probably encountered 2 problems:

1. No strict order.
2. A keyError is the key doesn’t exist.

These 2 problems can easily be solved without much hassle with 2 nice objects from the collections module in the Python standard library.
The first is the OrderedDict.
This object remembers the order in which it is made, so you will get the same order of objects when you loop through it, as when you first put the elements in. It works the same as a normal dictionairy in all ways

from collections import OrderedDict my_dict = OrderedDict() my_dict['first']="Gold" my_dict['second'] = "Silver" for medal in my_dict.values(): print(medal)

This will give:

The second object is the defaultdict.
This object lets you define what the default value is of a key so if you have not defined it yet, it will just get that value. The way this is assigned is by giving the function of its type like “list”,”dict”,”int”,”float” or by a function (or lambda) that returns the standard value
So a great use for this is when counting words in a text.
The variable “words_list” is a list with all the words from a text document in this example:

from collections import defaultdict counter = defaultdict(int) for word in words_list: counter[word] += 1

Now I can check for every word the count. If the word is not in the text, I do not get a KeyError, but the value 0.

Read this wizdom and more like it here

Javascript share buttons for your website


There are just a few steps that need to be followed in order to ensure that the share buttons work.
1. Ensure that jQuery is embedded in the head of the code.
2. Add the JavaScript link of the file which has the share buttons.

<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>;  
<script src="http://www.steamdev.com/zclip/js/jquery.zclip.min.js">; 
<link type="text/css" rel="stylesheet" href="style.css">  
<script src="script.js"></script>  
<link href='http://fonts.googleapis.com/css?family=Exo+2|Audiowide';
rel='stylesheet' type='text/css'>  
<script type="text/javascript" src="/share.min.js"></script  

3. Trigger the javascript in


4. Add text and links to the share properties in HTML.

<h1 id="color">Colourity</h1> 
<div id="instructions">Press the space bar to get started, then click to 
<div class="targetDiv"></div>  

<script type="text/javascript"> 
$('.targetDiv').share({ facebook: { 
name: 'title' 
link: 'url' 
image: 'share image' 
caption: 'picture caption' 
text: 'short description' 

twitter: { 
text: 'tweet text' 
link: 'url' 
gplus: { 
link: 'url' 

The Network Tab

Important tip from Mat, a Javascript wizpert:

If you’re doing any sort of work on the web it will do you well to get familiar with the Networking tab of your browser. Most browsers have one and it makes troubleshooting a surgical process rather than just shooting in the dark.

https://developer.chrome.com/devtools/docs/network has all the details for chrome.

This tab will show you what’s happening with your page. Any red? You’ve got errors to deal with.

You’ll see quickly which URL is causing trouble and why making issues like “CSS not loading” easy to fix.

The developer tools also have a whole boat load of features. Learn them well and take the guess work out of web development.

Read this wizdom and more like it here

Announcing our partnership with Crossrider

We’re excited to announce our new partnership with Crossrider!

Crossrider is one of the world’s leading platforms for extension development, with over 1 Billion installations. It allows developers to quickly build awesome extensions that support all major browsers, using Javascript.

We are delighted that Crossrider chose Wizpert to provide instant programming help to their community of developers with extensions and related programming questions.

This partnership further validates Wizpert’s reputation as the world’s most helpful community for programmers.

Our experts (wizperts) have helped users with well over 50,000 questions, and we are proud to have been selected for mentoring by students from all the leading online and brick-and-mortar code learning schools and programs.





SQL – do you know the basics?

If you can answer these basic questions posed by Simeonc, one of our SQL wizperts, than you are beginning to master SQL.

Answers are provided for your convenience, but no cheating :)

Q.How to retrieve specific columns from a table?
A: The first thing is to know how they are placed into the table.

Q.What is an auto increment?
A: An auto increment is a feature in databases which allows each record to be unique to that table for identification.

Q.What is rownum?
A: A rownum is a special virtual column you get on subqueries in ORACLE.

Q.What is a Sub Query?
A.It’s called a ‘table expression’ and it’s essentially anything that returns a record set, such as views and stored procedures, functions, subqueries.

Q.Can a Sub Query be aliased and considered as a table?
A: Yes it can, only when it is in the FROM statement.

Read this wizdom and more like it here

Testimonial from a serial code learner

This guest post was written by Ron, one of our long time users. [Warning: not for the faint of heart]:

I’ve been working on teaching myself HTML/CSS and JavaScript for the past seven months and have found that virtually all, or at least most of the online tutorials are lacking in several areas.

The main issues are that they do not have the students work through projects, and they do not supply sufficient mentorship to help students in understanding the material and problems put before them.

I have learned the hard way that both of these are essential in learning how to code. You need to have a goal to continuously work towards, a site to build or build upon, and you need to have someone answer your questions and correct you where you went wrong.

This is where Wizpert came in and helped me.

I have worked with Code Academy, Code School, Thinkful, Udemy, Udacity, Lynda, Treehouse, PluralSight, Aquent, Gymnasium and a few others. Some are better than others in teaching the core essentials and all have many good points in the sense that they genuinely appear to want to help people learn to code.

However, in the end, they all (yes all) fall short in teaching budding beginners to fully grasp HTML/ CSS and JavaScript. I have also found the teach-yourself books to be of even less help, even when they are touted by experienced web developers as being of value to beginners. They are more useful as reference material than anything else.

Though several sites actually do provide a “mentor,” with whom you meet once a week…this simply. Does. Not. Work. At this day and age, that’s literally no better than me using the US Postal Service to mail someone my code problem and having them mail their answer back to me. I doubt I am alone when I say that when I need help figuring out why my stupid floating divs aren’t floating the way they’re supposed to, I want an answer right g#@damn now. Which is, again, where Wizpert has come in.

They provided me with the essential help at the drop of a hat, 24/7. I cannot be a loud enough cheerleader for them. When Stack Overflow fails to answer one of my questions, Wizpert comes through, every single time.

Go create an account with Stack Overflow and try, just try to ask them a couple of questions. You’ll soon see why they fail in helping the beginner. They’ll send you home crying because you’re asking (god forbid) for someone’s “opinion” on how you should use that new HTML5 semantic [article] and [section] tags that has everyone confused. If there were no opinions in coding then there would be no need for online tutorials or places like Stack Overflow and every program could be nice and neatly packed into one pretty little book. …don’t even get me started. Stack Overflow is definitely NOT for beginners.

And when Google has failed in dredging up an answer to your padding/margin question, Wizpert is there for you at 11:30 at night to also help you center that pesky div or fix the navigation, padding, margin, linking and hover issues of your unorganized list!!

Did Stack Overflow or Google ever help you figure out how to indent that third checkbox, just a few pixels more to the right?? I didn’t think so. It didn’t help me either. Which, again, is where Wizpert comes in. If you need help in understanding why your If/Else isn’t working or why your loop is infinite, crashing your system. Bam! There’s a wizpert right friggin’ there to help right friggin’ now.

The peace of mind of being able to get help right when I need it, any time of the day, has kept me rolling in my learning where I am now no longer getting hung up for hours and hours on one stupid little issue that turned out to be nothing more than an improper relative URL.

Thanks guys. Thanks for being there, saving me an infinite amount of hours. You’ve helped me from giving up.

Entering the field of programming

If you are a new programmer looking to broaden your horizon and seeking how to get hands on practice with programming then keep reading on.

With the competitive market and flood of web application developers all over the globe. There has risen new markets for various applications, every industry values a programmer with certain programming background based on the core structure of their application.

As a new programmer it is always advisable to start with C programming, no matter how simple the others may seem and how much they attract the crowd. With that in mind, it is also important to notice the market trend in order to jump into the other languages once “C programming” is mastered. Even though it may seem challenging, it is by far the best starting point because it teaches the core of all programming language.

Php, python, ruby and similar web frameworks can be easily mastered once C programming has taken root and strong programming applications in C have been mastered. This not only gives birth to a genuine programmer but also one who has the ability to go back and forth between various different programming languages.

Read this wizdom and more like it here

Working with Nested Divs in CSS

When web programmers work with nested divs, they have to take care of a few things in order to ensure that the nesting works.
Our wizpert Wilson provided these small tips, which will save you a lot of time and frustration in developing websites:

  1. Ensure that the inner divs have margins, in order to differentiate.
  2. Keep the border color different from the that of the div.
  3. Set a margin for the outermost div and give it a height and width.

Read this wizdom and more like it here