Jump to content
TNG Community

404 error when navigating to TNG "pages"


KevyNC

Recommended Posts

Hello,

I assume I may need to put something in my .htaccess page (not sure exactly what) or if there is something else I can do to fix

When I navigating  the Wordpress pages -- I am fine, but when I access any  TNG page within the /root/tng1203   folder - I am getting a 404 error.  The page does load and display as expected other than the 404 error.  Does this have to do with the permalinks?   Again all WP pages display correctly. Appreciate any assistance. Thanks

https://alveslaborefamily.net/

image.png

 

Link to comment
Share on other sites

2 hours ago, klooster said:

Read this article about 404 error: 

Cees - thanks for the article

as I mention the item(s) are displaying --  so I do not think the article covers that situation

All items display from TNG but they ALL give 404 errors -- not sure if its related to breadcrumbs.  Maybe subdomain or redirect? its weird

Link to comment
Share on other sites

9 hours ago, KevyNC said:

not sure if its related to breadcrumbs

I think the breadcrumbs are in your header.php file, that's why you get error 404.

You can remove the breadcrumbs in mytngstyle.css

.fusion-page-title-bar {
  display:none!important;}

 

You can also use a custom TNG header in WordPress and remove the breadcrumbs code .

Screenshot_ HomePage_Alves_Labore.png

Link to comment
Share on other sites

Solution to your "404 error" problem on the TNG/AVADA pages 

Use the Child theme of AVADA, make directory "includes". Place a copy of AVADA custom_functions.php in that directory.

Find rule 195

$title = esc_html__( 'Error 404 Page', 'Avada' );

and change Error 404 Page into whatever you want (I changed it into Genealogy pages)

$title = esc_html__( 'Genealogy pages', 'Avada' );

On every TNG/AVADA page the title bar wil now show your text.

End last: disable as default the breadcrumbs in the AVADA Theme options

PS:

  • You can still use the breadcrumbs on the WP pages, but you have to turn them on in every WP page separately in the Page title bar Fusion page options.
  • If you use the custom css ( .fusion-page-title-bar { display:none!important;} as suggested by CFJ it will remove the page title bar in AVADA and the "404 error" message on the TNG pages. The downside of this method is that you cannot use the page title bar in the the normal WP pages

Schermafbeelding 2019-02-18 om 09.19.12.png

Schermafbeelding 2019-02-18 om 09.13.26.png

Schermafbeelding 2019-02-18 om 09.38.46.png

Link to comment
Share on other sites

Thank you. This should point me in the right direction.  I would prefer to leave breadcrumbs on, but not if they do not display correctly on any/all TNG "item"

Cees -- is the main reason I would need a child theme for this situation is because  of future wordpress updates?  (Still tying to understand when child themes are and are not necessary)

Thank you Kevin

Link to comment
Share on other sites

Hi Kevin,

A child theme is a theme that has all the functionality and styling of another theme called the parent theme, which in our case, is Avada. Child themes are the recommended way of modifying the code of an existing theme because a child theme preserves all custom code changes and modifications even after a theme update. If you modify code directly from a parent theme, then update the parent theme, your changes will be lost.

Read this: Avada child theme

 

Child  themes:

  • make your modifications portable and replicable;
  • keep customization separate from parent theme functions;
  • allow parent themes to be updated without destroying your modifications;
  • allow you to take advantage of the effort and testing put into parent theme;
  • save on development time since you are not recreating the wheel; and
  • are a great way to start learning about theme development.

The bottom line is, if you customize any WP theme, allways use a child theme.

Link to comment
Share on other sites

  • 1 month later...

Well, this thread just saved me a whole bunch of typing...  😍

Kevin, sorry I had not responded yet to your email.  A touch of mild pneumonia had sidetracked me for the past week.  I cannot stress the importance of what Dr. K said about child themes enough.  Avada comes packaged with one, so there is no need to manually create one or use a plugin solution for creation.  Luckily, you have not boxed yourself in.  First, using a backup plugin utility such as Updraft Plus, make a full backup of your WP files & database.  Save to something like Google Drive.  With the premium version, you can add all of your TNG files to the backup as well.  You then add the child theme to your WP theme library, use the Avada Theme Options Import/Export function to save all of the work you have done on the main theme to a JSON file on your local PC.  Reset ALL of the options on the main theme to Default--and then make the Child Theme active.  Again using Import/Export, import the configuration file into the active child theme.  Voila!  You are back in business, and can safely update the main Avada theme without risk.  I just upgraded to v5.9 on my new development site without issues.

@klooster I was just writing to you as to how you were getting "Genealogy Pages" into the title header instead of the error message.  I had just thrown my hands up in the air trying a number of hacks on the 404.php file to no avail.  Thanks for solving that!

Link to comment
Share on other sites

On 2/18/2019 at 8:43 AM, klooster said:

The bottom line is, if you customize any WP theme, allways use a child theme.

One little twist to this that I'm using...

I have made a number of modifications to a plugin that I use - the NextGen gallery plugin.

I've saved those modifications in a TNG Mod Manager .cfg file, and so each time the plugin is updated I use the Mod Manager from that site's TNG to put my changes back into the plugin's files.

Same with one file in the core WordPress files - I have a Mod Manager .cfg file that alters that so that the TNG Header over-rides the WordPress header on my Genealogy pages when using the TNG-WordPress plugin, and just Reinstall that Mod every time the WordPress file is updated.

Roger

Link to comment
Share on other sites

Roger, I too use the NextGen/NextGen Pro plugin.  It's quite the resource hog but makes for perfect galleries and albums.  I just made some changes in the CSS code for it to eliminate the Google+ feature (now discontinued by Google), and have added a few tweaks to it for my photography site.  

What specifically are you doing to change/enhance behaviors within the TNG portions of the WP/TNG bundle through mods--and how are you using NextGen as a TNG complement?

Link to comment
Share on other sites

27 minutes ago, PapaTango said:

What specifically are you doing to change/enhance behaviors within the TNG portions of the WP/TNG bundle through mods--and how are you using NextGen as a TNG complement?

It is nothing to do with using NextGen Gallery with TNG. I alter some of the outputs so that the image title AND description show under the images when viewing them. Eg the album that is here

http://lisaandroger.com/2017/04/wellington-day-2-mount-bruce/

And as noted I alter the header of the WordPress output when it is showing the TNG pages so that the TNG <title> tag shows rather than the WordPress <title> tag for the Genealogy page.

Roger

Link to comment
Share on other sites

Got it.  The NextGen Pro (paid) addition provides this titling and description function as both a slide-up on thumbnails when mousing over and hover, or bottom display on clicked full image page views.  It's good to find that this same functionality can be had with a few tweaks on the free version as well.

Link to comment
Share on other sites

7 hours ago, PapaTango said:

Kevin, sorry I had not responded yet to your email.  A touch of mild pneumonia had sidetracked me for the past week.  I cannot stress the importance of what Dr. K said about child themes enough.  Avada comes packaged with one, so there is no need to manually create one or use a plugin solution for creation.  Luckily, you have not boxed yourself in. 

thank for the tips Papa and Dr.K.  Dr. K always sounds like he know what he is doing.  However, for me.... due  to the newness some of WordPress aspects may get lost or not fully register  with me due to my lack of experience.  I may not be able to look at that until Monday

Link to comment
Share on other sites

One another question -- so basically I would run entire WordPress site in the Child Theme (after Exporting/Importing).... meaning all pages, posts and so on?

Link to comment
Share on other sites

8 hours ago, KevyNC said:

One another question -- so basically I would run entire WordPress site in the Child Theme (after Exporting/Importing).... meaning all pages, posts and so on?

Yes. Activate your child theme and test your site.

A child themes inherits all features of parent theme and you can customize it without making any changes to the parent theme itself.

Link to comment
Share on other sites

4 hours ago, cfj said:

Yes. Activate your child theme and test your site.

A child themes inherits all features of parent theme and you can customize it without making any changes to the parent theme itself.

Great thanks.  I really haven't made any changes to the parent theme other than the breadcrumbs to not show 404.  Do you have any suggestions on tutorials on using child themes and the differences between child and parent?

 

Thanks, Kevin

Link to comment
Share on other sites

Here is a page about Child theme

I would recommend a plugin, such as Generate Child Theme . It's easy to use.

Inside the child theme’s folder you will find a new CSS file, if you need to modify your theme.

You can download files from your parent theme and upload them into your child theme.

As an example I have one custom header to TNG. This is to avoid double doctype declaration.

By using "view page source" you will see what I mean.

DOCTYPE-declaration.png

 

 

Link to comment
Share on other sites

That is correct, Kevin.  The child theme 'inherits' the core functionality of the main theme--but when made active contains any CSS changes made to the various templates and features.  As noted with the "404 fix" they also allow certain core files to be copied and modified within the child theme itself--leaving the originals alone.  That way, the core features can be updated without mangling any customizations present in the child theme.  

One can use a plugin to make a single or multiple child themes, you can easily build one from scratch, or as in the case of Avada--one comes packaged in the theme download ZIP file.  The plugin method comes in handy for those who are not comfortable creating new files and are using older or very simple themes that do not have the child theme packaged with them.

Link to comment
Share on other sites

On 3/29/2019 at 1:25 PM, PapaTango said:

@klooster I was just writing to you as to how you were getting "Genealogy Pages" into the title header instead of the error message.  I had just thrown my hands up in the air trying a number of hacks on the 404.php file to no avail.  Thanks for solving that!

Papa,

I believe you can also use a CSS plugin to modify the breadcrumbs when a 404  is generated (usually when navigating to the TNG links)

BTW I hope you feeling better.

Thanks, Kevin

Link to comment
Share on other sites

I gave consideration to several methods of including breadcrumbs on the WP/TNG pages title headers--but decided to at the end to go with Dr. K's suggestion of globally suppressing the trail and turning it on as a single preference for individual native WP pages/articles.  The reasoning was simple--there was no real information given about the page itself--just an identical generic message for each page.  I suppose that one could include a hook in the code to query the TNG database for the page title (surnames, places, etcetera) but for what it is that was seen as a non-essential time waster.  The page title header "Genealogy Pages" alone works well for my sensibilities--and it is one less custom hack to deal with when upgrading components...  🤐

Link to comment
Share on other sites

Having spent several years away from my website (doing mapping), I am now moving my theme from Suffusion to Avada and updating lots of plugins. I had the same issue that KevyNC raised at the beginning of this thread - the page title bar contains 404 error.

I decided that I do not want any Avada page title bar for TNG pages, and searched various places for ideas. I find the following addition to functions.php in my Avada-Child-Theme works for me:

// Remove page_title_bar from tng pages

add_action( 'wp_loaded', 'avada_check_page' );
function avada_check_page() {
  if ( substr($_SERVER['REQUEST_URI'],0,5) === '/tng/' ) {
    add_action( 'avada_override_current_page_title_bar', 'avada_remove_title_bar' );
  }
}
function avada_remove_title_bar() {
}

I do not know if this is the best way. It works by removing the title bar if the url of a page is '/tng/' - which is where all my TNG pages are served from. I already have breadcrumbs off.

UPDATE: I should also mention I have switched from using the TNG/WP plugin to using Cees Koosterman's method of integration.

Edited by PeterC66
Link to comment
Share on other sites

I have a TNG Mod .cfg file that alters the WordPress file "general-template.php" and modifies the "function _wp_render_title_tag()"

It (only) works if you are using the TNG-WordPress plugin by knowing the pageID of your Genealogy page and testing for that - if it's not that, it outputs the normal WordPress title, if it is that, it suppresses the WordPress title so that the TNG title can take over.

Roger

Link to comment
Share on other sites

3 hours ago, PeterC66 said:

I decided that I do not want any Avada page title bar for TNG pages, and searched various places for ideas. I find the following addition to functions.php in my Avada-Child-Theme works for me:

Thanks Peter -- I will give this a try.

Kevin

Link to comment
Share on other sites

  • 1 year later...

On february 18, 2019 I posted a solution to the "404 error" problem on the TNG/AVADA pages.
The solution was:

* ================================================ *
Use the Child theme of AVADA, make directory "includes". Place a copy of AVADA custom_functions.php in that directory.
Find rule 195
$title = esc_html__( 'Error 404 Page', 'Avada' );
and change Error 404 Page into whatever you want (I changed it into Genealogy pages)
$title = esc_html__( 'Genealogy pages', 'Avada' );
On every TNG/AVADA page the title bar wil now show your text.
End last: disable as default the breadcrumbs in the AVADA Theme options.

* ================================================ *

After the AVADA update to V 7.1.1. this solution does not work anymore, the workaround is as follows:

You have to change a line in the file: class-fusion-helper.php

You can find this file in:  /wp-content/themes/Avada-/includes/lib/inc

Change line 342:
$title = esc_html__( 'Error 404 Page', 'Avada' );
Into:
$title = esc_html__( 'WHATEVER YOU WANT', 'Avada' )
;

PS:

Personally I did put the words Genealogy pages in it:
Checkout:
Genealogy pages

 

 

 

Link to comment
Share on other sites

@klooster I'm sorry, but according to the source code of your website, it still says Pages not found.

avada-title.png

 

English is not my native language so bear with me.😀

I'm far from an expert, so I could be wrong.

Without being rude, your source code is messy.

You have done a good job of explaining how to use TNG and WordPress together, but you recommend a template, which is too advanced for most users.

I personally recommend everyone to use WP default theme first, and test this out with TNG.

When everything works, choose a template that is lightweight and easy to use,
Don't use too many plugins.

Appearance on the website is important, but so is the source code.

Integrating TNG with WordPress is like a craftmanship and it needs to be done properly.

TNG uses its own scripts, so remember that everything you install of plugins on WordPress has an impact on the TNG pages.

Fast speed is important for anyone building an SEO-friendly website.

 


Anyone can compare two project source code, Kloosterman's and mine.

Regards Cathrin Jegersberg

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...