Site logo

Archived topic

Archive page not loading every assets from "Elements"

9 replies · Started by Charles on January 7, 2021

Viewing posts 1–10 of 10

Hello dear support,

first thing first : I love GP ! I've been using it for a few years and to me it's the BEST WP theme on the market.

But today, my favourite theme has let me down :( // EDIT : I was surprised that I found an error in GP. So, after a good night sleep, I realised I didn't check functions.php in my child theme, and wasn't surprised when I realised it was, again and as usual, a problem occuring between chair and keyboard... See fix below.

I think I have an issue with the Element section :
I have configured a few element to be loaded site wide, but archive pages don't.

So I encounter a few bug mostly related to JS not loading properly.

WP is up to date, as well as theme and plugins.

Things I've done so far :

  • Deactivated all plugins
  • Clear browser cache, server cache (FastCGI, Redis)
  • Disable all element but one (a fixed position Div, the red one on the right bottom corner)
  • Set WP debug True --> No error showing whatsoever

Nothing has worked out....

I thought it was pure JS issue first, but the fact that even a single div cant be rendered sitewide, whatever the hook I use, is telling me that something's not working the way it should.

I would really appreciate if anyone has a clue, tuts, anything that could help me resole that....

Website : https://dev.evazio.com
Archive (without the red DIV : https://dev.evazio.com/bretagne/)

I can provide any kind of access to server/CMS if you need.

Best regards

Charles

Hi,

I thought it was pure JS issue first, but the fact that even a single div cant be rendered sitewide, whatever the hook I use, is telling me that something’s not working the way it should.

We can definitely rule JS out as I've checked the page source and there's no hint of the <div> being added in on archive pages.

Can you fix the site permissions? I've tried logging in to your site to check but the /wp-admin page returns a Error 403.

Here are a few articles that may help you with this:
https://kinsta.com/blog/403-forbidden-error/
https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-403-forbidden-error-in-wordpress/

Let us know.

Forgot to clear wp-admin access.

Credential are attached in private information.

Forgot to clear wp-admin access.

Credential are attached in private information.

I've tried checking again but the site is asking for the authentication code.

Anyway, what were the <div>s that doesn't display on the archive pages? Is it only the one with the red background containing the dynamic viewport size?

Let us know when we could check things. Thank you.

Hello Elvin,

sorry, forgot to disable two-auth factor.

Httpauth is disabled, as well as two-fact auth., so you should be OK now (sorry).

The div I'm talking about is the one on the bottom right corner (<div></div>), with CSS breakpoints.

It doesn't appear on archive pages (https://dev.evazio.com/alaune/)
A few other things are missing (scripts, fonts like fontawesome wich is embedded through JS etc).

Hi there,

i tried your login - but it takes me to a magic password login and the Login with Username and Password then gets rejected

Hello David, Security Plugin deactivated
You can login with credentials in attachment

Ok, I found it, I was adding a PHP Snippet to display CPT in archive, and that's whats is messing around :

//AJOUT DES CPT A LA BOUCLE POUR LES ARCHIVES
add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
if( is_category() ) {
$post_type = get_query_var('post_type');
if($post_type)
$post_type = $post_type;
else
$post_type = array('nav_menu_item', 'post', 'voyage-velo','randonnee-pedestre', 'gastronomies'); // don't forget nav_menu_item to allow menus to work!
$query->set('post_type',$post_type);
return $query;
}
}

Disabled the function, everythings working OK. Now I have to figure out how to include CPT on archive witout breaking stuff XD

Thank you guys !

So here is the fix :

//Add custom post type to Wordpress loop
add_action('pre_get_posts', 'query_post_type');
function query_post_type($query) {
if($query->is_main_query()
&& ( is_category() || is_tag() )) {
$query->set( 'post_type', array('nav_menu_item', 'post', 'mycpt') );
}
}

Awesome - glad you found the issue and the solution!

This archived topic is closed to new replies.