715 posts
  • Author Level 2
  • Collector Level 2
  • Exclusive Author
  • Belgium
+1 more
Hy-Studio
says

Hello,

I’m encountering a problem with displaying a title on my front-page.php template file. I’ve got this as code:

<?php if( have_posts()) : ?>

<?php while( have_posts() ): ?>

   <div class="bottom-border bottom-padding article-paragraph">
                            <h2><?php single_post_title('',true) ?></h2>
                            <?php the_post() ?>
                            <?php the_excerpt() ?>
                            <p><span class="red-link"><?php the_time('l d-m-Y') ?></span> by <span class="red-link"><?php the_author() ?></span></p>

                        </div><!-- // margin-top -->

                    <?php endwhile; ?>
                <?php endif; ?>

I know that you all WP experts will find where I went wrong ;)

Thanks!

381 posts
  • Weekly Top Seller
  • Elite Author
  • Most Wanted Winner
  • Author Level 10
+7 more
redfactory
says

Hello,

I’m encountering a problem with displaying a title on my front-page.php template file. I’ve got this as code:

I know that you all WP experts will find where I went wrong ;)

Thanks!

You can just use “the_title()”, but place it under “the_post()”. That should fix it :)

715 posts
  • Author Level 2
  • Collector Level 2
  • Exclusive Author
  • Belgium
+1 more
Hy-Studio
says

wow, it’s to simple, why didn’t I see it :D

thanks!

by
by
by
by
by
by