• Resolved agthalim

    (@agthalim)


    Hi Camille,

    Sorry to bother you again (you had fixed my problems with custom markers),
    but since yesterday I get this message :”…leafletJS files are missing.”, instead of the usual map which worked perfectly.
    The extension seems updated, and I don’t know what’s wrong. Would you have the kindness to have a look ?

    Again and again : Thank you for this wonderful extension !!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Camille V

    (@socrapop)

    Dear @agthalim,

    Judging by the number of scripts loaded on your page (one), I think your theme has a problem ??

    You might have deleted the very important <?php wp_footer(); ?> function in your footer.php, or just before the </body> ending tag ??

    You also need a <?php wp_head(); ?> inside your <head></head>, but this might already be the case.

    Let me know,
    Camille

    Thread Starter agthalim

    (@agthalim)

    Dear Camille,
    Thank you for having looked.
    However, your answer puzzles me : Ichecked that there was no unwanted deletion of the previous content of the template for the opening page. I had made a theme from
    underscores. Here’s the code :

    <?php
     /* The template TemplateAnthologieCartigraphiee.php, qui sert de page d'accueil pour le site ecopoetique
    /* Template Name: TemplateAnthologie_cartographiee  */
    get_header();
    ?>
    <main id="primary" class="site-main">
     
    <div class="container-fluid"; style="background-color: blue;">
          <div class="row">
          <!--1ere colonne, pour le menu ;
          La classe bg-info ajoute un fond bleu à l'élément-->
               <div class="col-md-3 bg-info">
               				ici un menu ?>
                </div>
            <!--2ème colonne, pour la carte-->
                    <div class="col">
                                                    
    					<?php
                		while ( have_posts() ) :
                			the_post();
                			get_template_part( 'template-parts/content', 'page' );
    
                			// If comments are open or we have at least one comment, load up the comment template.
                			if ( comments_open() || get_comments_number() ) :
                				comments_template();
    	               		endif;
    
    	               	endwhile; // End of the loop.
    	       			?>
                    
                        </div>
                   </div>
                 	
                </div>
            </div>
        </body>
    
    	</main><!-- #main -->
    
    <?php
    get_sidebar();
    get_footer();
    ?>
    

    Please tell me how else can I help you help me ?

    Thank you !
    (by the way : I don’t see why there are many scripts loaded ?…)

    Plugin Author Camille V

    (@socrapop)

    Yes, I see a problem in your code ??

    Your template page has an error, you are closing the </body> tag, which need to be the last closed element (just before </html>).

    The

    </div>
        </div>
        </body>

    elements shouldn’t be here, they are not closing anything, OR they are closing tags fromheader.php too early.

    In your code, get_header() is calling header.php (in your theme) and get_footer() is calling footer.php

    By convention, header.php has the <head></head> element with <?php wp_head(); ?> inside and the <body> opening tag just after </head>.
    The footer.php has the </body> ending tag and <?php wp_footer(); ?> just before </body>.

    You should check inside those files and remove the closing tags

    </div>
        </div>
        </body>

    from the bottom of your template page.

    • This reply was modified 3 years ago by Camille V.
    • This reply was modified 3 years ago by Camille V.
    Thread Starter agthalim

    (@agthalim)

    Thank you for this instructive answer, Camille.
    Indeed I checked that header.php contains the line :

    <body <?php body_class(); ?>>

    ,
    and that footer.php contains the line :

    </body>

    So this was deleted from my template. Thanks for the explanation.

    However, the closing </div>’s did correspond to a div (class:”container-fluid”) and a div for a row (bootstrap stuff).

    It seems that unfortunately, the question seems related to the plugin itself : a page without a map, based on that template works (e.g. https://ecopoetique.huma-num.fr/2-2/)
    Pour info, here’s the template :

    `<?php
    /* The template TemplateAnthologieCartigraphiee.php, qui sert de page d’accueil pour le site ecopoetique
    /* Template Name: TemplateAnthologie_cartographiee */
    get_header();
    ?>
    <main id=”primary” class=”site-main”>
    <?php
    while ( have_posts() ) :
    the_post();
    get_template_part( ‘template-parts/content’, ‘page’ );

    // If comments are open or we have at least one comment, load up the comment template.
    if ( comments_open() || get_comments_number() ) :
    comments_template();
    endif;
    endwhile; // End of the loop.
    ?>
    </main><!– #main –>
    <?php
    get_sidebar();
    get_footer();
    ?>`

    `

    Now, if I just add the shortcode

    [travelers-map]

    , I get the ”…leafletJS files are missing.”
    So now I’m considering supressing the plugin and installing it again. But of course I’m terrified at the idea that I could lose data.

    Do you have a ny suggestion as to how to proceed ?
    Thank you !

    • This reply was modified 3 years ago by agthalim.
    Plugin Author Camille V

    (@socrapop)

    You don’t need to reinstall the plugin, but if you do you will “only” lose the settings in the settings page. All the posts markers will be kept (it is explained in the travelers map settings page)

    You can also save you database with any backup plugin available, to be sure ??

    For your problem, I still think there is something missing in your footer.php
    Have you been searching for the wp_footer() function in your footer.php file ?
    And for the wp_head() function in your header.php ?

    Wordpress by default is loading jQuery on every webpage (unless you unregistered it manually), and your website doesn’t have it.

    Maybe you can copy/paste your footer.php here to see if everything is ok ?? Another test would be to download another plugin to display something with javascript on your page with a shortcode, like leaflet map ?? (try it on another page like the test page you linked)

    • This reply was modified 3 years ago by Camille V.
    Thread Starter agthalim

    (@agthalim)

    Thank you Camille,
    It’s fixed now. I couldn’t find why, but I installed a nex underscore theme, and the traveler’s map extension works gloriously !

    Sorry for having unnecesarily disturbed.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can’t find why’ is closed to new replies.