715 posts
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in 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
  • Has referred 500+ members
  • Has sold $250,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+6 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
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in 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