2 edited body
source | link

adding this line of code and adjusting my if statement has damaged my links onin the pageloop. I really don't understand why this has happened. What is wrong with the line of code?

        <?php $query = new WP_Query( array( 'post__not_in' => get_option( 'sticky_posts' ) ) ); ?>

          <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>

            <div class="posts__post">

                <article>
                    <a class="posts__post--preview" href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
                    <p class="posts__post--tag"><?php the_category('&nbsp;/&nbsp;'); ?></p>
                    <h1 class="posts__post--title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
                    <p class="posts__post--meta"><?php echo time_ago(); ?></p>
                </article>   


            </div>

          <?php endwhile; else :?>

          <h1><?php _e('no post where found!','blog'); ?></h1>

        <?php endif; ?>

        </div>

adding this line of code and adjusting my if statement has damaged my links on the page. I really don't understand why this has happened. What is wrong with the line of code?

        <?php $query = new WP_Query( array( 'post__not_in' => get_option( 'sticky_posts' ) ) ); ?>

          <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>

            <div class="posts__post">

                <article>
                    <a class="posts__post--preview" href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
                    <p class="posts__post--tag"><?php the_category('&nbsp;/&nbsp;'); ?></p>
                    <h1 class="posts__post--title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
                    <p class="posts__post--meta"><?php echo time_ago(); ?></p>
                </article>   


            </div>

          <?php endwhile; else :?>

          <h1><?php _e('no post where found!','blog'); ?></h1>

        <?php endif; ?>

        </div>

adding this line of code and adjusting my if statement has damaged my links in the loop. I really don't understand why this has happened. What is wrong with the line of code?

        <?php $query = new WP_Query( array( 'post__not_in' => get_option( 'sticky_posts' ) ) ); ?>

          <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>

            <div class="posts__post">

                <article>
                    <a class="posts__post--preview" href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
                    <p class="posts__post--tag"><?php the_category('&nbsp;/&nbsp;'); ?></p>
                    <h1 class="posts__post--title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
                    <p class="posts__post--meta"><?php echo time_ago(); ?></p>
                </article>   


            </div>

          <?php endwhile; else :?>

          <h1><?php _e('no post where found!','blog'); ?></h1>

        <?php endif; ?>

        </div>
1
source | link

WP_Query causing links to not work

adding this line of code and adjusting my if statement has damaged my links on the page. I really don't understand why this has happened. What is wrong with the line of code?

        <?php $query = new WP_Query( array( 'post__not_in' => get_option( 'sticky_posts' ) ) ); ?>

          <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>

            <div class="posts__post">

                <article>
                    <a class="posts__post--preview" href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
                    <p class="posts__post--tag"><?php the_category('&nbsp;/&nbsp;'); ?></p>
                    <h1 class="posts__post--title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
                    <p class="posts__post--meta"><?php echo time_ago(); ?></p>
                </article>   


            </div>

          <?php endwhile; else :?>

          <h1><?php _e('no post where found!','blog'); ?></h1>

        <?php endif; ?>

        </div>