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 $500,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!

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by