[resolved] get template part and child theme (3 posts)

  1. martcol
    Posted 3 years ago #

    I am using The Bootstrap theme as the parent to my child. I want to fiddle with The Loop and I have managed to get my head around get_template_part but it took me a while to realise that it uses a whole series of content.php files to serve different loops for different circumstances.

    I now want to add my own content.php file in my child theme and can't work this out because the files are in a sub-folder in the parent theme folder called "partials"

    The Bootstrap uses this:

    while ( have_posts() ) {
    	get_template_part( '/partials/content', get_post_format() );

    I want to use conent-listing.php to pull content from a Custom Post Type. Can someone please help me work this out?



  2. Michael
    Forum Moderator
    Posted 3 years ago #


    Child themes can override these templates the same as before — the child theme will just need to create the same directory structure to do it. (So, /page-templates/one-column.php needs to be overridden with /page-templates/one-column.php, not /one-column.php.)

  3. martcol
    Posted 3 years ago #

    Thank you that really helps

Topic Closed

This topic has been closed to new replies.

About this Topic