Jump to content
TNG Community
KevyNC

404 error when navigating to TNG "pages"

Recommended Posts

KevyNC

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

 

Share this post


Link to post
Share on other sites
klooster

Read this article about 404 error:

404-error

Share this post


Link to post
Share on other sites
KevyNC
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

Share this post


Link to post
Share on other sites
cfj
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

Share this post


Link to post
Share on other sites
klooster

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

Share this post


Link to post
Share on other sites
KevyNC

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

Share this post


Link to post
Share on other sites
klooster

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.

Share this post


Link to post
Share on other sites
PapaTango

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!

Share this post


Link to post
Share on other sites
theKiwi
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

Share this post


Link to post
Share on other sites
PapaTango

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?

Share this post


Link to post
Share on other sites
theKiwi
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

Share this post


Link to post
Share on other sites
PapaTango

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.

Share this post


Link to post
Share on other sites
KevyNC
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

Share this post


Link to post
Share on other sites
KevyNC

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?

Share this post


Link to post
Share on other sites
cfj
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.

Share this post


Link to post
Share on other sites
KevyNC
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

Share this post


Link to post
Share on other sites
cfj

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

 

 

Share this post


Link to post
Share on other sites
PapaTango

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.

Share this post


Link to post
Share on other sites
KevyNC
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

Share this post


Link to post
Share on other sites
PapaTango

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...  🤐

Share this post


Link to post
Share on other sites
PeterC66

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

Share this post


Link to post
Share on other sites
theKiwi

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

Share this post


Link to post
Share on other sites
KevyNC
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×