Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP How to Build a WordPress Theme WordPress Theme Functions The WordPress Loop

not the same ??

hi

i wrote the same code put it didn't give me the same result
it shows just the header and first paragraph . why ??

Imagine I asked you what colour shirt I am wearing? You wouldn't know as I haven't told you. Now with that in mind we are unable to answer your question as we don't know what code you have entered or even what the original code was supposed to do. If you could share exactly with code and a description what is going on they we can problem solve your issue and give you an informed answer.

Thanks

2 Answers

Nick Fuller
Nick Fuller
9,027 Points

I suggest you checkout out the Wordpress Codex and read through their documentation for 'The Loop'.

https://codex.wordpress.org/The_Loop_in_Action

I believe what you're asking is why wordpress is truncating each blog post?

The loop purposefully only shows the first "excerpt" from the post, otherwise you would have a REALLY long page with ALL your blog posts and ALL their content.

For example: http://blog.teamtreehouse.com/

This is Treehouse's blog page. See how this page lists multiple blog posts, and truncates the content? That's exactly what is happening to you! In the next video I believe Zack reviews how to create a single-page for a blog post.

<?php get_header(); ?>

<p> this is the front-page.php file . </p>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

 <h3><?php the_titel(); ?> </h3> 
  <?php the_content(); ?> 

  <hr>

<?php endwhile; else: ?>

<p> there is no postes in this page </p>

<?php endif;?>

<?php get_footer(); ?>


this is the code i wrote its should show mw the home page , when put it in home.php it should show me the postes that i have create .

but non of these result come .

all what i see on my browser

this is the header

this is the front-page.php file

=====