WordPress.org

Ready to get started?Download WordPress

Forums

get_template_part() doesn't load dynamic content (2 posts)

  1. ericperson
    Member
    Posted 3 years ago #

    I am trying to use <?php get_template_part( 'loop', 'charts' ) ?> to show a formatted loop in various of my templates. I have a loop-charts.php file with html and php code. The loop worked when it displayed in the template file but now does not display any posts when it's separated into the loop-charts.php file. I know it is getting the template file because if I add any arbitrary html, it displays that on the page. Just no posts.

    Any ideas?

  2. ericperson
    Member
    Posted 3 years ago #

    Does a template part need to start with a php tag or any sort of header? My file starts with html (a
    <ul> tag).

Topic Closed

This topic has been closed to new replies.

About this Topic