Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

=====