[Resolved] Archive page not loading every assets from “Elements”

Home Forums Support [Resolved] Archive page not loading every assets from “Elements”

Home Forums Support Archive page not loading every assets from “Elements”

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1610053
    Charles

    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

    #1610196
    Elvin
    Staff
    Customer Support

    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.

    A wise man once said:
    "Have you cleared your cache?"

    #1610400
    Charles

    Forgot to clear wp-admin access.

    Credential are attached in private information.

    #1610450
    Elvin
    Staff
    Customer Support

    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.

    A wise man once said:
    "Have you cleared your cache?"

    #1610459
    Charles

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

    #1610697
    David
    Staff
    Customer Support

    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

    #1610699
    Charles

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

    #1610729
    Charles

    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 !

    #1611069
    Charles

    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’) );
    }
    }

    #1611072
    David
    Staff
    Customer Support

    Awesome – glad you found the issue and the solution!

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.