Forums

[resolved] templatepath makes page content disappear (10 posts)

  1. CatLady916
    Member
    Posted 2 years ago #

    This is my first wordpress theme - and I'm having trouble...

    I'm making a pure static site and i'm making my page.php - this is the code i'm having issues with:

    <div id="contentWrap">
    <?php include(TEMPLATEPATH . '/sidebar2.php'); ?>
    
    <div class="content btmPad">
    <?php the_content(); ?>
    
    </div>
    
    </div><!-- end of contentWrap -->

    before i added TEMPLATEPATH, the content from my static pages were visible, however when I add TEMPLATEPATH, the content disappears. what am i doing wrong? any help will be greatly appreciated?

  2. Edward Caissie
    Member
    Posted 2 years ago #

    I would suggest replacing
    TEMPLATEPATH
    with
    bloginfo('template_url')

  3. alchymyth
    The Sweeper
    Posted 2 years ago #

    after you tried @cais' suggestion,
    have a look into sidebar2.php and check if something could be wrong in there. also, check the produced html code in your browser (View Source in IE; View PageSource of Ctrl U in firefox) to see haw far the php files got executed.

    did you get any error messages on the screen?
    link to your site?

  4. CatLady916
    Member
    Posted 2 years ago #

    @cais - i will try your suggestion this evening and keep you posted - thank you!!!

    @alcymyth - i don't get any error messages, i forgot to add that the sidebar2.php does appear when i use TEMPLATEPATH - it just doesn't make my the_content tag work...

  5. CatLady916
    Member
    Posted 2 years ago #

    oh yeah and i'm developing this locally then i will make it live

  6. CatLady916
    Member
    Posted 2 years ago #

    ok - so i replaced it this way in the code:

    <?php include(bloginfo('template_url') . '/sidebar2.php'); ?>

    and this is what it produced in the browser where the content should be:

    http://localhost/wordpress/wp-content/themes/qualityStyle

    while this isn't what i wanted it to do - it did produce something in the content area and the sidebar2!

    so am i doing something wrong to this code?

  7. CatLady916
    Member
    Posted 2 years ago #

    ok - so i replaced it this way in the code:

    <?php include(bloginfo('template_url') . '/sidebar2.php'); ?>

    and this is what it produced in the browser where the content should be:

    http://localhost/wordpress/wp-content/themes/qualityStyle

    while this isn't what i wanted it to do - it did produce something in the content area and the sidebar2!

    so am i doing something wrong to this code?

  8. alchymyth
    The Sweeper
    Posted 2 years ago #

    'the_content()' needs the wordpress loop to work

  9. CatLady916
    Member
    Posted 2 years ago #

    oh! i thought i needed to use the loop to display blog posts - so i need it to display static page content too?

    i'll try that this evening and keep you posted - thanks!!!

  10. CatLady916
    Member
    Posted 2 years ago #

    thank you so much alchymyth! that TOTALLY worked!

    i'm teaching myself while following along in a book and the book's example is a blog and it touches briefly on static pages - so i assumed that the loop was just for blog posts...

    yay!!! when i make the site live (over the weekend) - i'll post the link...thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic