Skip to main content
Highlight code, remove noise, misc
Source Link
Gabriel
  • 2.2k
  • 10
  • 22
  • 24

I'm starting to reach my wit's end regarding a problem I'm having with get_template_part. I am developing a website that requires specific pages to have certain elements change color in addition to a full-width calendar page. I figured that using page templates and changing what get_template_partget_template_part looks for would be the simplest approach, but I've run into unexpected trouble. The page template loads fine, but the specific content template appears to get ignored, with WordpressWordPress instead loading the general template. I'm using a child theme derived from TwentyFifteenTwenty Fifteen, but this shouldn't be a problem, since the customized content template loads just fine.

get_template_part( 'content', 'page', 'kahvilaravintola' );

get_template_part( 'content', 'page', 'kahvilaravintola' );

This is the get_template_part itself. It should be loading content-page-kahvilaravintola.phpcontent-page-kahvilaravintola.php, located right in the child theme's folder, but instead loads content-page.phpcontent-page.php, located in the same folder. I've tried to solve this for a while but I can't seem to figure out what is wrong.

I'm starting to reach my wit's end regarding a problem I'm having with get_template_part. I am developing a website that requires specific pages to have certain elements change color in addition to a full-width calendar page. I figured that using page templates and changing what get_template_part looks for would be the simplest approach, but I've run into unexpected trouble. The page template loads fine, but the specific content template appears to get ignored, with Wordpress instead loading the general template. I'm using a child theme derived from TwentyFifteen, but this shouldn't be a problem, since the customized content template loads just fine.

get_template_part( 'content', 'page', 'kahvilaravintola' );

This is the get_template_part itself. It should be loading content-page-kahvilaravintola.php, located right in the child theme's folder, but instead loads content-page.php, located in the same folder. I've tried to solve this for a while but I can't seem to figure out what is wrong.

I am developing a website that requires specific pages to have certain elements change color in addition to a full-width calendar page. I figured that using page templates and changing what get_template_part looks for would be the simplest approach, but I've run into unexpected trouble. The page template loads fine, but the specific content template appears to get ignored, with WordPress instead loading the general template. I'm using a child theme derived from Twenty Fifteen, but this shouldn't be a problem, since the customized content template loads just fine.

get_template_part( 'content', 'page', 'kahvilaravintola' );

It should be loading content-page-kahvilaravintola.php, located right in the child theme's folder, but instead loads content-page.php, located in the same folder. I can't seem to figure out what is wrong.

Source Link

Get_template_part seems to be ignoring my template

I'm starting to reach my wit's end regarding a problem I'm having with get_template_part. I am developing a website that requires specific pages to have certain elements change color in addition to a full-width calendar page. I figured that using page templates and changing what get_template_part looks for would be the simplest approach, but I've run into unexpected trouble. The page template loads fine, but the specific content template appears to get ignored, with Wordpress instead loading the general template. I'm using a child theme derived from TwentyFifteen, but this shouldn't be a problem, since the customized content template loads just fine.

get_template_part( 'content', 'page', 'kahvilaravintola' );

This is the get_template_part itself. It should be loading content-page-kahvilaravintola.php, located right in the child theme's folder, but instead loads content-page.php, located in the same folder. I've tried to solve this for a while but I can't seem to figure out what is wrong.