• Resolved catlady916

    (@catlady916)


    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?

Viewing 9 replies - 1 through 9 (of 9 total)
  • I would suggest replacing
    TEMPLATEPATH
    with
    bloginfo('template_url')

    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?

    Thread Starter catlady916

    (@catlady916)

    @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…

    Thread Starter catlady916

    (@catlady916)

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

    Thread Starter catlady916

    (@catlady916)

    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:

    https://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?

    Thread Starter catlady916

    (@catlady916)

    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:

    https://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?

    ‘the_content()’ needs the wordpress loop to work

    Thread Starter catlady916

    (@catlady916)

    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!!!

    Thread Starter catlady916

    (@catlady916)

    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!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘templatepath makes page content disappear’ is closed to new replies.