0

I do not know why I can not get the admin login bar (when I'm logged in) and why two widgets disappeared in the footer, knowing that the problem only occurred on one page template of the site that I'm developing, I tried to understand before asking you for help and I saw that a margin was added leaving a white space instead of the site's bar. I think it's a concern at the level of the call of the footer, here is the code, do not hesitate to ask more details.

enter image description here

enter image description here

enter image description here

here is the code:

<?php
    /**
        * Template name: Résultat des competitions
     */

get_header(); ?>

    <section id="primary" class="content-area col-md-12">
        <main id="main" class="site-main" role="main">
            <header class="entry-header">
                <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
            </header>

            <div class="avrbreadcrumb">
                <?php 
                   if(function_exists('get_hansel_and_gretel_breadcrumbs')): 
                      echo get_hansel_and_gretel_breadcrumbs();
                   endif;
                ?>
            </div>

            <div class="strikeonce2">
                <form  method="post" action="<?php bloginfo('url');?>/resultat/">
                    <?php  $taxonomies = get_object_taxonomies('resultat');
                        foreach($taxonomies as $tax){
                            echo buildSelect($tax);
                        }
                    ?>
                    <input type="submit"/>
                </form>
            </div>

            <?php
                if (get_query_var('paged')) {
                    $paged = get_query_var('paged');
                } elseif (get_query_var('page')) { // 'page' is used instead of 'paged' on Static Front Page
                    $paged = get_query_var('page');
                } else {
                    $paged = 1;
                }
                $args = array(
                'post_type' => 'resultat',
                'numberposts' => -1,
                'post_status' => null,
                'post_parent' => null,
                'posts_per_page' => 7,
                'paged' => $paged  //very important
                );

                // The Loop
                $custom_query = new WP_Query($args);
                if ($custom_query->have_posts()) : ?>

                    <nav class="herdewebnav"> 
                        <?php echo pagination($custom_query->max_num_pages); ?>
                    </nav>
                    <?php
                     while ($custom_query->have_posts()) : $custom_query->the_post();
                            ?>

                            <div class="resultclub">
                                <div class="resultwrap">    
                                    <h2>
                                        <a href="<?php the_permalink(); ?>" target="_blank"><?php echo the_title(); ?></a>
                                    </h2>
                                    <div class="arrowresult">
                                        <figure>
                                            <img src="http://avenirderennes-gymnastique.fr/wp-content/uploads/2018/04/arrowclubpurple.png" width="20" alt="fleche résultats" />
                                        </figure>
                                        <a href="<?php the_permalink(); ?>" target="_blank">
                                            <p>Voir les résultats</p>
                                        </a>
                                    </div>
                                    <figure class="figuresult">
                                        <img src="http://avenirderennes-gymnastique.fr/wp-content/uploads/2018/04/COUPES-avenir-de-rennes.png" alt="résultat" width="60" />
                                    </figure>
                                </div>
                                <?php 
                                     $ID = get_the_ID();
                                            $page_data = get_page( $ID );
                                            $excerp = strip_tags($page_data->post_excerpt);

                                    if ( !empty( $excerp ) ) : ?>
                                        <?php the_excerpt(); ?>
                                    <?php
                                    else :
                                        echo '';
                                    endif;
                                ?>

                            </div>

            <?php  endwhile;  ?>

          <nav class="herdewebnav"> 
                <?php if (function_exists("pagination")) {
                    pagination($custom_query->max_num_pages);
                } ?>
          </nav>
          <?php $wp_query = $orig_query; ?>
     <?php endif;
          wp_reset_postdata();

        ?>


        </main><!-- #main -->
    </section><!-- #primary -->

<?php
get_footer();
  • Turn debug mode on and search for fatal errors - most probably you have some error in your PHP and the script dies. – Krzysiek Dróżdż May 2 '18 at 14:16
  • Great! thank you, I was actually not in debug mode, the problem was widgets that I had wrongly stated in the footer – Frenchy35 May 3 '18 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.