Notifications
Clear all

wpForo 1.x.x [Closed] How to Edit the Default Forum 404 Page

9 Posts
7 Users
2 Reactions
12.4 K Views
Posts: 52
Topic starter
(@thedrawingboard)
Trusted Member
Joined: 6 years ago

Can you please tell me how I can edit the default 404 Page for the forum?

Currently this 404 page has the text:

"Oops! The page you requested was not found!
You can go to Forum Home page or Search here"

I'd like to edit this text to let people know they need to be logged in to the forum in order to see the private threads, as well as other basic information. 

I found where I can change the Phrase "Page Not Found", but I can't find where to change the text in the error message.

Thanks for any help!

8 Replies
1 Reply
(@crisw)
Joined: 6 years ago

Reputable Member
Posts: 281
Posted by: thedrawingboard

(1) Can you please tell me how I can edit the default 404 Page for the forum?

Currently this 404 page has the text:

"Oops! The page you requested was not found!
You can go to Forum Home page or Search here"

(2) I'd like to edit this text to let people know they need to be logged in to the forum in order to see the private threads, as well as other basic information. 

I found where I can change the Phrase "Page Not Found", but I can't find where to change the text in the error message.

Thanks for any help!

Hi @thedrawingboard

(1) I can write and tell you about where it is, but I think that it will create more problems than it would solve, if you change anything in that 404 file.  If the intention is to get the end result (2), here's an easier way to do it.   🙂 

  1. Go to Forum Dashboard
  2. Forums
  3. Then select the Category of the Forum you want to hide from guests (Blue Bar
  4. Click the Edit button (next to the + sign)
  5. Then under Forum Permissions
  6. For Guests - on the drop down menu, select No Access
  7. Click the Update button

The result of that is that Forum Category will only be visible to logged in users. 

However, if you want to keep the Category visible to the guest, but have one or two forums under that, visible only to Members, you can follow the same steps, but just click the edit button of the 3. specific Forum (under the Blue Category Bar), that you want visible only to Members. Follow same steps 4 to 7.  

The result you will get is the Category is visible, and then when a guest tries to click, this message will appear: 

(2) "You don't have permissions to see this page, please register or login for further information"

I hope that helps.  Good luck and God bless you.  🙂 

Sofy
Posts: 4900
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @thedrawingboard,

If you like to customize the appearance of the 404 page, you should customize the 404.php file located in /wp-content/plugins/wpforo/wpf-themes/classic/ folder.  

Please read this doc for wpForo customization:

https://wpforo.com/docs/root/forum-themes/theme-customization/

If you'd like to change only the phrases, please navigate to Dashboard > Forums > Dashboard admin page, click on [Rebuild Phrases] button, then navigate to Dashboard > Forums > Phrases admin page, find the phrases and change as you like. 

More info here: https://wpforo.com/docs/root/translation/quick-translation-phrases/

Posts: 75
(@maxelio42)
Estimable Member
Joined: 6 years ago

Hi,

One small part of our forum is on restricted access to only a few users.

When these users receive a notification email concerning a new message from this restricted area, and when they click the included link to view the message in the forum, they fall upon this 404 page.

The only exception is if they are already connected when clicking the link.

I precise that I followed thouroughly your step (1), @crisw.

This is not very elegant ! Would it be possible, in this specific case, to lead them to a page with a specific message, inviting them to login to see the page?

Thanks for your help!

3 Replies
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

Ok, we'll add this in our-to-do list and add in future releases.

copilot
(@copilot)
Joined: 6 years ago

Eminent Member
Posts: 26

After receiving today a bug report from a customer, we found that this problem too. Would be great that when visiting urls of forums and topics, who do exist but are hidden for not logged in users, show the login page if the user is not logged in.

Thanks Robert for considering!

copilot
(@copilot)
Joined: 6 years ago

Eminent Member
Posts: 26

@maxelio42,

Perhaps this helps you.

For my website, I added a login to the WPForo 404 error page. See the result on this restricted topic: https://easyvfr4.aero/community/feedback-on-features-and-functionalities/circuit-height-on-ev4-plates/

Not sure if this is the most elegant method 😉 but this is how I did it:

First, add the following code to the child theme's function.php in order to create the shortcode [my-login-form]:
// START add login shortcode
add_action( 'init', 'my_add_shortcodes' );
function my_add_shortcodes() {
   add_shortcode( 'my-login-form', 'my_login_form_shortcode' );
}
function my_login_form_shortcode() {
   if ( is_user_logged_in() )
      return '';
   return wp_login_form( array( 'echo' => false ) );
}
// END of add login shortcode

Then, add the following code to the, in the wpforo plugin folder located, 404.php file and edit the 404 error text as you like.:
<p style="align:center"><?php echo do_shortcode("[my-login-form]"); ?></p>

Note: once you update the wpforo plugin you probably lose this line of code, so you have to check/ edit the 404.php file after every wpforo update.

 

Cheers,
Tim

Posts: 281
(@crisw)
Reputable Member
Joined: 6 years ago

Hi @copilot . Thank you for sharing your code.  That will surely help those Admins who have their own customized LogIn and Register pages.  🙂 

What I use in my forum is the wpForo Register and LogIn Pages.  It was raised in my Forum too that if a post is set to "Standard Access" in a Private Forum, it's not clear to others that the page exists, but only visible to those who are logged in.  

So I tweaked it some, and added the verbiage through "Phrases". 

Here's how I did it. 

1) Go to  Forum Dashboard

2) Phrases 

3) On the search box, type "Page Not Found

4) It will return two phrases: 

"The Forum - Page Not Found" is the page title

and the 

"404 - Page Not Found" is the sub title in orange font. 

5) So if you hover over that, you'll see the "edit" link, and you can click it

6) You should also type on the search box "Oops! The page you requested was not found!" - that's also the sub title in orange font. 

So if you hover over that phrase, you'll see the "edit" link, and you can click it. 

7) And you can just add whatever verbiage you want to inform visitors to either Register or Login.  

8) Additionally, you can add a Register or Login Link on the 404.php page, on Line 21.  

Something like: (Change the code in RED to your own)

<p><center><strong>Or you can   <a href="https://www.YOUR-WEBSITE.com/COMMUNITY/?wpforo=signup" target="_blank" rel="noopener">Register</a>  or  <a href="https://www.YOUR-WEBSITE.com/COMMUNITY/?wpforo=signin" target="_blank" rel="noopener">Log in</a>  and  <a href="https://www.YOUR-WEBSITE.com/COMMUNITY/YOUR-CONTACT-PAGE/" target="_blank" rel="noopener noreferrer">Contact Us here</a></center></strong></p> 

I don't recommend tweaking the 404 because as the Support Team suggests, it is not "update safe" - meaning any customizations will be overwritten on any future updates.  (That's why I initially typed it might create more problems than it solves).  But I think tweaking the "phrases" would be a tad bit safer.  🙂 

And here is a sample of my "not elegant" 404 page 🙂

Posts: 47
(@dlinstedt)
Trusted Member
Joined: 6 years ago

I think, wpForo should add this to their list of features, a new tab in their SETTINGS area to customize 404 page.

This type of functionality can be found (as an example for what & how) in Ultimate Member, and in wpFusion.com