WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Ten
[resolved] get_template_part new part not showing up (2 posts)

  1. hayley@ohmedia.ca
    Member
    Posted 2 years ago #

    Hey, I'm using Twenty Ten as a theme base. I created a custom template file for a certain part of the site I needed to look differently.

    template file name: portfolio-template.php
    get_template_part file name: loop-portfolio.php
    code used in portfolio-template.php:

    <?php
    get_template_part( 'loop', 'portfolio' );
    ?>

    This follows the same pattern as the existing loop-page.php, loop-single.php, etc. but nothing inside loop-portfolio.php is printed to the screen. I edited portfolio-template.php to use

    <?php
    get_template_part( 'loop', 'page' );
    ?>

    and that works. I'm not sure where my roadblock is - the syntax of get_template_part, or loop-portfolio.php itself.

    Thanks!

    http://wordpress.org/extend/themes/twentyten/

  2. hayley@ohmedia.ca
    Member
    Posted 2 years ago #

    Aha ha ha ha weird. I decided to try it one more time, again starting from scratch with the code from loop-page.php, and it worked. I'm guessing my previous try had some sort of bad code in it. Resolved!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags