Support

GoTryTHIS News and Techniques

U of GTT #7: WordPress Fix (Update 3)

I’m very happy to announce we have a new WordPress fix, which should make GoTryTHIS and WordPress work perfectly together.

Here are the steps, including testing and troubleshooting:

 

Part 1:

1. Create a new text document on your computer called 404.php with the following content:

<?PHP
chdir('gotrythis');
require_once "gotrythis.php";
exit;
?>

2. With FTP, put the file into the folder of the WordPress theme you are using. It will be one of the folders in /wp-content/themes/. If you are not sure which one, copy it into all of them. If your theme already has a 404.php file, rename it to something else, such as wp404.php.

3. Test a GoTryTHIS link on that domain. If it does not work, it is probably because you installed GoTryTHIS into a different folder than normal. If that is the case, edit the 404.php file and change the first “gotrythis” to the folder name you installed to for that domain.

4. Test internal blog links. If they do not work, try going into your WordPress admin, click on “Settings”, then “Permalinks”, and then “Save Changes”. That should reapply your WordPress changes to your .htaccess file.

5. Visit a made up link on your blog that doesn’t exist. If it was using the 404.php that you renamed to wp404.php (or whatever you renamed it to), then please follow the instructions in Part 2.

 

Part 2: If you were already using the WordPress 404.php

This is only required if you were using the WordPress 404 error page and want it to continue to match the look of your blog.

1. Login to your WordPress admin and create a new page (not a post).

2. Give the page a title such as “Not Found” and change the permalink to for the page to “notfound”. Using the WordPress editor, type in the content that you want to appear on the custom error page.

3. Go into your GoTryTHIS Dashboard, go to the management page, click the domains tab, choose the domain, and then edit the “Custom 404 Error Document” to point to the the notfound page, such as http://www.yourdomain.com/notfound. Test the made up link again.

 

Part 2B: Removing the “notfound” from the menu in the blog

This is required only if the notfound page is showing up in your menu on your blog.

1. Go into your WordPress admin, go to the Edit Pages screen, and hover your mouse over the “Not Found” page you created. Look at the status bar to see its post number. (Example: action=edit&post=122 means the post number is 122.)

2. Go to the Theme -> Editor and load “header.php”

3. Look for the part that contains the following code or similar:

$pages = wp_list_pages(’sort_column=menu_order&title_li=&echo=0&depth=1&exclude=’.$GLOBALS['archives_id']);

4. Add the page number (122 in our example) to the “exclude” portion, followed by a comma, like this:

$pages = wp_list_pages(’sort_column=menu_order&title_li=&echo=0&depth=1&exclude=122,’.$GLOBALS['archives_id']);

5. Test your non-existing link again. It should go to the WordPress notfound page you created, and that page should not be displayed int he generated page menu.

 

Troubleshooting:

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in
/home/xxxxx/public_html/wp-content/themes/xxxx/i404.php
on line 2

This probably is because you didn’t install GoTryTHIS in /gotrythis/ and need to change the path in “chdir(’gotrythis’);” from part 1, step 1, to the correct path. You will also get this error if you try to load your 404 page directly in the browser.

Leave a Reply

SIGN UP... So You Don't Miss Anything:

Get News And Notice Of New Features,

Tips, Tutorials, Guest Articles, And More!