1

Currently I'm creating a product review site with Wordpress for tafe/college. Everything is going to plan except for one issue - on the single post page.

I'm getting the title, the date submitted, the post image. But for some bizarre reason my sidebar has vanished and the content is gone as well. I'm guessing either I've missed out a good portion of php code somewhere.

I actually have a test site where the content is located so u can get a better look: www.sbmwebdesign.com (It's just a site used for tafe work, will expire in a short time).

My code is below:

<?php 
get_header();
?>

<div class="title_wrapper container">
                    <div class="span12">
                        <div class="span6">
                            <h1><?php /* post title */ the_title() ;?></h1>
                        </div>
                        <div class="breadcrumbs">
                            <strong><a href="index.html">Home</a> / <a href="blog-right-sidebar.html">Reviews</a>  / <?php /* post title */ the_title() ;?></strong>
                        </div>
                    </div>
            </div>
            <div class="container blog blog-ind">
                <div class="row">
                    <div class="span8">
                        <div class="blog-post">
                            <div class="blog-image">
                                <a href="#"><img src="<?php echo get_stylesheet_directory_uri();?>/img/defaults/817x320.jpg" class="attachment-817x320 wp-post-image" alt="2" height="320" width="817"></a>
                                <div class="blog-date">
                                    <span class="date"><?php 
    // Date published (Returns a formatted date string)
        the_time('l jS F');?></span>
                                    <!-- <div class="plove"><a href="#" class="heart-love" id="heart-love-499" title="Love this"><span class="heart-love-count"><span class="icon-heart"></span>54</span></a></div> -->
                                </div>
                                <div class="blog-rating">
                                    <div class="overall-score">
                                        <div class="rating r-45"></div>
                                    </div>
                                </div>
                                <!-- blog-rating -->
                            </div>
                            <!-- blog-image -->
                            <div class="">
                                <h2><?php /* post title */ the_title() ;?></h2>
                            </div>
                            <!-- blog-content -->
                            <div class="blog-info">
                                <!--<div class="post-pinfo">
                                    <span class="icon-user"></span> <a data-original-title="View all posts by admin" data-toggle="tooltip" href="#">admin</a> &nbsp;
                                    <span class="icon-comment"></span>  <a data-original-title="3 Comments" href="#" data-toggle="tooltip">
                                    3 Comments</a> &nbsp;
                                    <span class="icon-tags"></span><a href="#"> Adventure,  </a>  <a href="#"> RPG,  </a>  <a href="#"> Shooter,  </a>  <a href="#"> Strategy,  </a> 
                                </div>-->
                                <div class="clear"></div>
                            </div>
                            <!-- /.blog-info -->
                            <!-- <?php get_review() ;?> -->
                            <div class="blog-content">
                                <p><?php $content = get_the_content(); ?></p>
                            </div>
                            <!-- /.blog-content -->
                            <div class="clear"></div>
                        </div>
                        <!-- /.blog-post -->
                        <div class="clear"></div>
                        <div class="block-divider"></div>
                    </div> 

                    <?php 
get_sidebar();
?>
</div>
<?php endwhile; ?>
            </div>
            <?php
            get_footer();
            ?>

<!-- JavaScript -->
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript" src="js/jquery.cookie.pack.js"></script>
        <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
        <script type="text/javascript" src="js/jquery-migrate.min.js"></script>
        <script type="text/javascript" src="js/jquery.fancybox.js"></script>
        <script type="text/javascript" src="js/jquery.elastic.source.js"></script>
        <script type="text/javascript" src="js/jquery.carouFredSel-6.2.1-packed.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.10.3.custom.min.js"></script>
        <script type="text/javascript" src="js/jquery.ui.totop.js"></script>
        <script type="text/javascript" src="js/jquery.validate.min.js"></script>
        <script type="text/javascript" src="js/login-with-ajax.js"></script>
        <script type="text/javascript" src="js/bootstrap-button.js"></script>
        <script type="text/javascript" src="js/bootstrap-carousel.js"></script>
        <script type="text/javascript" src="js/bootstrap-collapse.js"></script>
        <script type="text/javascript" src="js/bootstrap-modal.js"></script>
        <script type="text/javascript" src="js/bootstrap-tab.js"></script>
        <script type="text/javascript" src="js/bootstrap-tooltip.js"></script>
        <script type="text/javascript" src="js/bootstrap-transition.js"></script>
        <script type="text/javascript" src="js/bootstrap-popover.js"></script>
        <script type="text/javascript" src="js/easing.js"></script>
        <script type="text/javascript" src="js/global.js"></script>
        <script type="text/javascript" src="js/imagescale.js"></script>
        <script type="text/javascript" src="js/login-with-ajax.source.js"></script>
        <script type="text/javascript" src="js/main.js"></script>
        <script type="text/javascript" src="js/theme.min.js"></script>
        <script type="text/javascript" src="js/tinymce.min.js"></script>
        <script type="text/javascript" src="js/transit.js"></script>
        <script type="text/javascript" src="js/admin.js"></script>
        <script type="text/javascript" src="js/greensock.js"></script>
        <script type="text/javascript" src="js/layerslider.transitions.js"></script>
        <script type="text/javascript" src="js/layerslider.kreaturamedia.jquery.js"></script>
        <script type="text/javascript" src="js/tabs.js"></script>
        <script>
            jQuery("#layerslider").layerSlider({
                pauseOnHover: false,
                autoPlayVideos: false,
                skinsPath: './layerslider/skins/',
                responsive : true,
                responsiveUnder : 1200,
                layersContainer : 1200,
                skin_name: 'fullwidth',
                navStartStop: false
            });
        </script>

       <!-- End JavaScript -->

    </body>
</html>
1
  • Btw to get to the page in question just click on the post shown in the index page. Commented Jun 1, 2015 at 3:21

1 Answer 1

2

Look at your browser page source. I see Fatal error: Call to undefined function get_review()

(That's the first thing to always do; check your browser source).

You can't use <!-- and --> HTML comments to comment out or deactivate a PHP call.

Use instead

<?php /* get_review() ; */?>

or

<?php // get_review() ;?>

All PHP after that undefined function failure won't execute, so none of the end of post and/or sidebar HTML appears, so the rest of the page doesn't appear.

You can use <!-- and --> to add a comment like this

<!-- comment here about what is going on -->

by itself without it surrounding any PHP code.

See http://codex.wordpress.org/Commenting_Code

Sign up to request clarification or add additional context in comments.

1 Comment

Fixed Mark! Used the wrong code to try and comment that part out. Thanks. Problem is though that that get_review part was supposed to grab some code belonging to a review.php file I made up to show in the content. Just wasn't working for some reason so I wanted to take it out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.