Skip to content

Commit d290aeb

Browse files
authoredOct 11, 2023
Merge pull request #699 from helsingborg-stad/fix/archive-not-working-with-centered-page-template
Fix: Centered page template works in archives
2 parents a2492dd + 8fe6bc4 commit d290aeb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎library/Template.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ function ($viewData, $params) {
122122
*/
123123
public function loadController(string $template = ''): array
124124
{
125-
if (is_archive() && $template === 'one-page') {
126-
$template = 'archive';
127-
}
128-
129125
//Do something before controller creation
130126
do_action_deprecated(
131127
'Municipio/blade/before_load_controller',
@@ -138,6 +134,10 @@ public function loadController(string $template = ''): array
138134
$isSingular = fn() => is_singular();
139135
$isArchive = fn() => is_archive() || is_home();
140136

137+
if ($isArchive) {
138+
$template = 'archive';
139+
}
140+
141141
$hasContentType = fn() => ContentTypeHelper::hasAnyContentType(get_post_type() ?? '');
142142

143143
$templateController = fn() => ControllerHelper::camelCase($template);

0 commit comments

Comments
 (0)