Project

General

Profile

Bug #2187

404 Error following activation of child theme.

Added by Paul Hebert almost 9 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority name:
Normal
Category name:
WordPress (misc)
Target version:
Start date:
2012-10-13
Due date:
% Done:

0%

Estimated time:

Description

In the last update, a child theme was installed for the ESA site. It seems to be working mostly fine. The custom post type shows up with its custom taxonomies and the [display-posts] short code I added to the functions is working. However, when I click on a profile link, displayed via the code, it doesn't show up. I've double checked the addresses and that doesn't seem to be it. My best guess is that there's something not working with the profile-single.php or the profile-content.php file. Since I can't access these files I can't be sure. So close!

To see what I mean, follow the steps below:

http://gcenglish.commons.gc.cuny.edu => Meet => Students => Hebert, Paul => leads to a 404 Error

profiles-page.png (197 KB) profiles-page.png Dominic Giglio, 2012-10-21 05:22 PM
single-profile.png (240 KB) single-profile.png Dominic Giglio, 2012-10-21 05:22 PM

History

#1 Updated by Dominic Giglio almost 9 years ago

  • Target version set to 1.4.8

Thanks Paul.

I'm going to look into this today, will let you know what I find.

#2 Updated by Dominic Giglio almost 9 years ago

Paul,

First, I apologize for the delay in getting to this ticket. I am right in the middle of midterms and EVERYTHING has been crazy.

Here's what I've done to try and fix this issue:

1.) functions.php - I cleaned up some of the code formatting to make it more readable and to bring it inline with WP coding standards. I also consolidated and renamed some of the functions to decrease the chances of naming conflicts.
2.) profile-content.php - I cleaned up and reorganized the html tags and structure. There were a few unclosed and unused tags.
3.) single-profile.php - Pretty much the same thing as number 2
4.) style.css - I added some custom styles to improve the layout of both student and alumni pages.

In addition to the cleanup and refactoring of the HTML and PHP, I've also beefed up the displaying of profile images. The code now checks to see if there is a Featured Image (what you call a Profile Picture) and displays that by default. If there is no profile picture it attempts to retrieve a Gravatar using the "Email" value from the "Basic Profile" metabox. The benefit of this is that if there is no profile picture or email address then a default Gravatar will be displayed. This way there is always some form of image to keep styling and layout consistent.

Furthermore, I've added a new Page Template named profile-page.php. This template is almost exactly the same as the parent's page.php except it removes all the commenting and author info boxes. It can be enabled on the live site by going to Pages->All Pages in the admin and editing both the Alumni Profiles and Student Profiles pages. On the edit screen for each page is the Page Attributes metabox, just choose "Profiles" from the Template dropdown list and you'll be good to go. Let me know if you have trouble with this.

I believe the 404 issue we're experiencing stems from the HTML and PHP errors I've tried to correct in single-profile.php and profile-content.php. I think WP tried to render those templates and when it couldn't, it fell back to the 404 error template in the parent. Hopefully my edits will correct this problem, but we won't know until it's up on production. Boone will be releasing 1.4.8 later tonight so you'll be able to test very soon.

Boone, Matt,

I tried to separate my commits a little so there isn't a single blob of a commit full of red and green lines:

added specific styles for alumni and student profile pages.
single-profile.php html structure cleanup and reorganization.
profile-content.php html structure cleanup and reorganization.
functions.php code cleanup and restructuring.
added profile page template.

I'm moving this issue to 1.4.9 just incase there are any more conflicts or tweaks that need to be addressed. This gives us (and Paul) all the way until Nov 1st (1.4.9 release) to make sure everything is good to go.

Paul, as always, just let me know if you run into problems and we'll get them all worked out. I've also attached 2 screenshots showing what my local env looks like with the new page template and custom styles.

#3 Updated by Paul Hebert almost 9 years ago

Dominic,

Wow, it sounds like you basically re-authored the pages. I knew the code was janky, but it was working on my localhost. Thank you so much. The improved listing page is much cleaner looking.

Unfortunately, the link to the actual profile post is still not working. You get the same error when you click on my name. This also happens when you preview the post in the editor. What's the next idea?

#4 Updated by Boone Gorges almost 9 years ago

Paul - Looks like your permalink settings hadn't been flushed to account for the new "Profiles" post type. I just resaved your Permalink settings and it looks like you're now able to access the content in question: http://gcenglish.commons.gc.cuny.edu/profile/hebert-paul/

#5 Updated by Dominic Giglio almost 9 years ago

BOONE TO THE RESCUE!!!

Thanks Boone.

Paul,

I wouldn't say I re-authored, just pulled the code together a little more tightly. Looks like I might have a small error on the individual (single) profile page though. I'm seeing double profile images. To answer your question from above, this will be my next step. :-)

#6 Updated by Paul Hebert almost 9 years ago

Thanks Dominic and Boone, it's now working. I wonder if the permalink setting was the initial problem... cleaner code is always better, though.

The double profile picture is a fluke and is not an error. You'll see that I've changed it. It just had the same image in the post as was the profile picture.

#7 Updated by Matt Gold almost 9 years ago

Many thanks to all of you for your work. The site looks great! Congrats, Paul and thanks for helping out, Boone and Dom.

#8 Updated by Dominic Giglio almost 9 years ago

  • Status changed from New to Resolved

It is possible that the permalink settings could've been the original problem.

I'm just glad it's working. :-)

I'm closing this issue as resolved. I assume we may have some more work to do regarding creating new profiles, but I think we should open a new issue if we have problems with that.

Also available in: Atom PDF