715 posts
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Belgium
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
Yaeko 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
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Microlancer Beta Tester
  • Most Wanted Bounty Winner
  • Has been a member for 4-5 years
  • Referred between 200 and 499 users
  • Bought between 10 and 49 items
+1 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
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Belgium
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
Yaeko says

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

thanks!

by
by
by
by
by
by