The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "SVG" Oct 14 - 6:30 PM Eastern
Get a free trial // Grow your CSS skills // Land your dream job

WordPress Starkers Utilites::get_template_parts Problems Loading Parts

  • # March 23, 2013 at 7:39 am

    I have been developing a theme for WordPress for a couple of days now using Starkers Blank Theme.
    I have been using the starkers utilities to insert template parts. I discovered a problem when I tried to load to parts after each other.

    < ?php Starkers_Utilities::get_template_parts( array( 'parts/shared/sidebar','parts/shared/html-sidebar') ); ?>
    < ?php Starkers_Utilities::get_template_parts( array( 'parts/shared/footer','parts/shared/html-footer' ) ); ?>

    When I run this code, it only ever displays the sidebar. Strangely, if I set them to call the same part twice. It displays how you would expect. The other strange thing I found was that if I load them the other way around. It also displays how you would expect. I believe it may be something to do with my html-sidebar.php file which simply contains this:
    “< ?php wp_sidebar(); ?>“

    My sidebar.php file contains nothing but HTML.

    I was not sure if this was the correct way to call the sidebar.php, however it seemed to work. Does anyone know a solution to my problem.


    # March 23, 2013 at 11:14 am

    Solved it by myself.

    # April 5, 2013 at 12:39 pm

    How did you solve it, George Arnall? You could at least show the courtesy to share your solution. Only then you could mark this as “solved”, as there would be a solution in that topic.

    # April 5, 2013 at 12:41 pm

    I didn’t need to add the < ?php wp_sidebar() ?> in html_sidbar.php. So this file is blank.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed