Support » Fixing WordPress » tag doesnt work on frontpage

  • Resolved helvetica123

    (@helvetica123)


    hello, <hr> tag works on a separate html page outside of WordPress but it doesnt work when i paste it to frontpage.php . how can i solve this problem?

    <hr>
    
    <style> hr
        { border:0; height:20px; background:url("https://image.freepik.com/free-photo/cute-cat-picture_1122-449.jpg") 0 0;
        }   </style>

    frontpage :

    <?php get_header(); ?>
    <section class="container">
     <div class="row">
         <div class="col-lg-8 bg-danger">
             <div class="row">
             <div class="col-lg-12 bg-info">
                 <?php $args= array(
            'posts_per_page' => 3
          ); ?>
          <?php $entries =  new WP_Query($args); while($entries->have_posts()): $entries->the_post(); ?>
    
                 <div class="col-lg-6 entry" >
    
                  <div class="entry-content">
          <?php the_post_thumbnail('entry',  array('class' => 'img-responsive') ); ?>
                      <h3><?php the_title(); ?></h3>
                      <p>
                        Published on: <span> <?php the_time(get_option('date_format') ); ?></span>
                      </p>
                      <p>
                        By: <span><?php the_author(); ?></span>
                      </p>
                      <a href="<?php the_permalink(); ?>" class="btn btn-success">Read more</a>
                  </div>
              </div>
    
          <?php endwhile; wp_reset_postdata(); ?></div>
         </div>
     </div>
    
     <div class="col-lg-4 bg-danger">
          <?php get_sidebar(); ?>
     </div>
     </div>
    
     <div class="row">
         <div class="col-lg-12 bg-success"> <?php $args= array(
            'posts_per_page' => 3
          ); ?>
          <?php $entries =  new WP_Query($args); while($entries->have_posts()): $entries->the_post(); ?>
    
                 <div class="col-lg-4 entry" >
    
                  <div class="entry-content">
          <?php the_post_thumbnail('entry',  array('class' => 'img-responsive') ); ?>
                      <h3><?php the_title(); ?></h3>
                      <p>
                        Published on: <span> <?php the_time(get_option('date_format') ); ?></span>
                      </p>
                      <p>
                        By: <span><?php the_author(); ?></span>
                      </p>
                      <a href="<?php the_permalink(); ?>" class="btn btn-success">Read more</a>
                  </div>
              </div>
    
          <?php endwhile; wp_reset_postdata(); ?></div>
    
     </div>
    </section>
Viewing 5 replies - 1 through 5 (of 5 total)
  • I couldn’t see it in frontpage.php
    Where did you put it?

    at the top and after <?php get_header(); ?> .

    also this code doesnt work ON FRONTPAGE:

    <div class="image">
    
          <img src="https://image.freepik.com/free-photo/cute-cat-picture_1122-449.jpg" alt="" />
          
         
    <button><span>Click me</span></button>
    </div>
    
    <style>
    
    .image { 
       position: relative; 
       width: 100%; /* for IE 6 */
    }
    
    button { 
       position: absolute; 
       top: 200px; 
       left: 0; 
       width: 100%; 
    }
        
        
        button span { 
       color: white; 
       font: bold 24px/45px Helvetica, Sans-Serif; 
       letter-spacing: -1px;  
       background: rgb(0, 0, 0); /* fallback color */
       background: rgba(0, 0, 0, 0.7);
       padding: 10px; 
    }
    </style>

    i pasted to the line which “here” written .

      <center>
      <?php if ( has_post_thumbnail() ) {
    the_post_thumbnail('entry',  array('class' => 'img-responsive') );
    } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" />
    
    HERE
                                 
                              
    <?php } ?> </center>
    • This reply was modified 1 year, 5 months ago by  helvetica123.

    couldn’t see an
    <hr>
    in frontpage.php
    do you have a link to the site?

    its solved

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘tag doesnt work on frontpage’ is closed to new replies.