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

WordPress

Konrad Pilch
Konrad Pilch
2,435 Points

Whats wrong with hits? why no display?

HI,

Whenever i paste my variables, it breaks the code under. WHy?

<?php
/*
    Template Name: Home Page
 */
?>
<?php get_header(); ?>

<?php

$main_image_home                =   get_filed('main_image');
$introduction_section_home      =   get_filed('introduction_section_title');
$description_home               =   get_filed('description_of_you');
$button_home                    =   get_filed('button_text');


?>

         <!-- Wrapper-content -->
        <div class="home-tagline">
                <h1><div id="textRange"></div><br></h1>
        </div><!-- /tagline -->


        <div class="entry-image">
            <div id="main" class="row custom-home-page">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12">

                            <div class="image-overflow">
                                <div class="main-image">

                                <?php if( !empty($main_image_home) ) : ?>
                                    <img <?php echo $main_image['url']; ?> alt="<?php echo $main_image['alt']; ?>" >
                                <?php endif; ?>
                                </div><!-- /main-image -->
                            </div><!-- image-overflow -->


                            <div class="title">
                                <h1><?php echo $introduction_section_home ?></h1>
                                <small>
                                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
                                </small>
                                <p>
                                    <button class="btn btn-large btn-success">incididunt ut labore et dolore magna!</button>
                                </p>
                            </div><!-- title -->

                        </div><!-- /col-xs-12 -->
                    </div><!-- /row -->
                </div><!-- /container -->
            </div><!-- /main --> 
        </div><!-- /entry-image -->


       <!-- Home Blog -->

        <div id="wrapper-latest-home">
            <div class="container">
                <div class="wrapper-home-post">
                    <div class="the-container">
                        <div class="row">
                            <div class="home-post col-md-6">
                                <h4><small>Latest Post Blog</small></h4>

                                <h3><a href="">The post title: The post description something hey!</a></h3>

                                <div class="meta-author">
                                    By Aurelian Spodarec on August 29, 2015
                                </div><!-- /meta-author -->


                                <div class="comment-count">
                                    <a href="">18 Comments</a>
                                </div><!-- /comment-copunt -->


                                <img src="<?php bloginfo('stylesheet_directory'); ?>/assets/img/ferr.jpg">

                                <div class="description">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
                                    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                                    consequat. Duis aute irure dolor in reprehenderit in volum.</p>
                                    <br>
                                    <a class="moretag" href="">Continue reading...</a>
                                </div><!-- /description -->

                                <button type="button" class="btn btn-success">Check out the blog</button>
                            </div><!-- /col -->


                            <div class="home-post col-md-6">
                                <h4><small>Latest Post Blog</small></h4>

                                <h3><a href="">The post title: The post description something hey!</a></h3>

                                <div class="meta-author">
                                    By Aurelian Spodarec on August 29, 2015
                                </div><!-- /meta-author -->


                                <div class="comment-count">
                                    <a href="">18 Comments</a>
                                </div><!-- /comment-copunt -->


                                <img src="<?php bloginfo('stylesheet_directory'); ?>/assets/img/pen.jpg">

                                <div class="description">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
                                    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                                    consequat. Duis aute irure dolor in reprehenderit in volum.</p>
                                    <br>
                                    <a class="moretag" href="">Continue reading...</a>
                                </div><!-- /description -->

                                <button type="button" class="btn btn-success">Check out the blog</button>
                            </div><!-- /col -->
                        </div><!-- /row -->
                    </div>
                </div><!-- /wrapper-home-post -->
            </div><!-- /container -->
        </div><!-- /wraper-latest-home -->

<?php get_footer(); ?>

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

You may try changing get_filed() to get_field()

Konrad Pilch
Konrad Pilch
2,435 Points

Lal spelling mistake ;d

Thank you!