0

I'm trying to code in the file index.php, but the footer and the slider that is in the content.php file don't display.

index.php code:

<?php
get_header();
    if (have_posts()) :
         while (have_posts()) :
              the_post();
              get_template_part('content', get_post_format());
         endwhile;
    else:
         get_template_part('content');
    endif;
get_footer();
?>

footer.php :

  <footer>
    <div class="footer-content">
        <img class="logo" src="ressources/logoge.png" alt="logo AEG">
        <div class="contact">
            <h3>Contact</h3>
             <p>Lorem ipsum dolor sit amet, <br>
             consectetuer adipiscing elit,sed diam nonummy nibh</p>
        </div>
        <div class="conditions">
            <h3>Conditions generales</h3>
            <p>Lorem ipsum dolor sit amet, <br>
            consectetuer adipiscing elit, sed diam nonummy nibh</p>
        </div>
        <div class="rss">
            <h3>Reseaux sociaux</h3>
            <button>
                <img src="ressources/iicon.png">
            </button>
            <button>
                <img src="ressources/ficon.png">
            </button>
             <button>
                 <img src="ressources/ticon.png">
            </button>

        </div>
    </div>
      <?php wp_footer(); ?>
  </footer>
 </body>
</html>

content.php:


    <!-- Slideshow container -->
    <div class="slideshow-container">
      <!-- Full-width images with number and caption text -->
      <div class="mySlides fade">
        <img src="ressources/walpaper9.jpeg" style="width:1000px">
        <div class="slide-text">
            <p>Lorem ipsum dolor sit amet</p>
            <h2>AEG TEST</h2>
        </div>
      </div>

      <div class="mySlides fade">
        <img src="ressources/walpaper6.jpeg" style="width:1000px">
        <div class="slide-text">
            <p>Lorem ipsum dolor sit amet</p>
            <h2>AEG TEST</h2>
        </div>
      </div>

      <div class="mySlides fade">
        <img src="ressources/walpaper2.jpeg" style="width:1000px">
        <div class="slide-text">
            <p>Lorem ipsum dolor sit amet</p>
            <h2>AEG TEST</h2>
        </div>
      </div>

      <!-- Next and previous buttons -->
      <a class="prev" onclick="plusSlides(-1)">&#10094;</a>
      <a class="next" onclick="plusSlides(1)">&#10095;</a>
    </div>
    <br>

    <!-- The dots/circles -->
    <div style="text-align:center">
      <span class="dot" onclick="currentSlide(1)"></span>
      <span class="dot" onclick="currentSlide(2)"></span>
      <span class="dot" onclick="currentSlide(3)"></span>
    </div>

    <div class="archives-container">
        <div class="archives">
            <div class="archives-preview">
                <h2>Base de données ADHEMAR et <br>
                 archives numerisées</h2>
            </div>
            <div class="archives-btn">
                <button class="btn">Archives online</button>
            </div>
        </div>
    </div>
    <div class="newsletter-container">
         <div class="newsletter">
            <div class="newsletter-preview">
                <h2>Newsletter</h2>
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, <br>
                sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna </p>
            </div>
            <div class="newsletter-btn">
                <input class="lbl" type="text" id="textlabel" placeholder  ="Nom,Prenom">
                <input class="lbl" type="email" id="emaillabel" placeholder="email">
            </div>
        </div>
    </div>
     <div class="archives-v2">
            <h2>Base de données ADHEMAR et <br>
            archives numerisées </h2>
            <div class="btnarchive">
                <button class="btn-archives-v2">Archives online</button>
            </div>
     </div>
    <div class="newsletter-v2">
        <h2>Newsletter</h2>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, <br>
         sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna </p>
         <input class="lbl" type="text" id="textlabel" placeholder  ="Nom,Prenom">
         <input class="lbl" type="email" id="emaillabel" placeholder="email">
    </div>

    <div class="container-grid">
        <img src="ressources/wallpaper1.jpeg">
        <img src="ressources/walpaper2.jpeg">
        <img src="ressources/walpaper4.jpeg">
        <img src="ressources/walpaper4.jpeg">
        <img src="ressources/walpaper6.jpeg">
        <img src="ressources/walpaper2.jpeg">
        <img src="ressources/walpaper8.jpeg">
        <img src="ressources/walpaper9.jpeg">
        <img src="ressources/walpaper10.jpg">
        <img src="ressources/walpaper11.jpeg">
        <img src="ressources/walpaper6.jpeg">
        <img src="ressources/walpaper9.jpeg">
    </div>
    <?php wp_content(); ?>
<script>
    let slideIndex = 1;
    showSlides(slideIndex);

    // Next/previous controls
    function plusSlides(n) {
        showSlides(slideIndex += n);
    }

    // Thumbnail image controls
    function currentSlide(n) {
        showSlides(slideIndex = n);
    }

    function showSlides(n) {
        let i;
        let slides = document.getElementsByClassName("mySlides");
        let dots = document.getElementsByClassName("dot");
        if (n > slides.length) { slideIndex = 1 }
        if (n < 1) { slideIndex = slides.length }
        for (i = 0; i < slides.length; i++) {
            slides[i].style.display = "none";
        }
        for (i = 0; i < dots.length; i++) {
            dots[i].className = dots[i].className.replace(" active", "");
        }
        slides[slideIndex-1].style.display = "block";
        dots[slideIndex-1].className += " active";
    }
</script>

After a lot of modifications trying to find what is wrong, when I inspect the page, I can not see the footer.

3
  • 1
    WordPress does not have a function named wp_content, so what were you trying to do with that <?php wp_content(); ?> in your content.php template? Is that your custom function?
    – Sally CJ
    Feb 27 at 12:10
  • 1
    the_content(); ?
    – Rup
    Feb 27 at 12:14
  • 1
    If you can't see the footer at all then there was probably a fatal error that stopped the page from loading. Enabled WP_Debug to see any errors that might be occurring: wordpress.org/documentation/article/debugging-in-wordpress. Trying to use a function that doesn't exist, like wp_content() would cause an error like this Feb 27 at 12:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.