php - Wordpress the_content loop issue -
currently i'm creating product review site wordpress tafe/college. going plan except 1 issue - on single post page.
i'm getting title, date submitted, post image. bizarre reason sidebar has vanished , content gone well. i'm guessing either i've missed out portion of php code somewhere.
i have test site content located u can better look: www.sbmwebdesign.com (it's site used tafe work, expire in short time).
my code 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 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 posts admin" data-toggle="tooltip" href="#">admin</a> <span class="icon-comment"></span> <a data-original-title="3 comments" href="#" data-toggle="tooltip"> 3 comments</a> <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>
look @ browser page source. see fatal error: call undefined function get_review()
(that's first thing do; check browser source).
you can't use <!--
, -->
html comments comment out or deactivate php call.
use instead
<?php /* get_review() ; */?>
or
<?php // get_review() ;?>
all php after undefined function failure won't execute, none of end of post and/or sidebar html appears, rest of page doesn't appear.
you can use <!--
, -->
add comment this
<!-- comment here going on -->
by without surrounding php code.
Comments
Post a Comment