Skip to content

Commit

Permalink
Clean up Listing page code
Browse files Browse the repository at this point in the history
- Remove unnecesary code
  • Loading branch information
dantovbein committed Jun 14, 2024
1 parent 4e1b72a commit c10af5b
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 16 deletions.
3 changes: 1 addition & 2 deletions archive-p4_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@
$context['custom_body_classes'] = 'tax-p4-page-type';
$context['header_title'] = post_type_archive_title('', false);

$page = new ListingPage($templates, $context);
$page->view();
new ListingPage($templates, $context);
9 changes: 1 addition & 8 deletions author.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@
'width' => '300',
'height' => '300',
];

$author_share_buttons = new stdClass();
$author_share_buttons->title = $author->name;
$author_share_buttons->description = get_the_author_meta('description', $author->ID);
$author_share_buttons->link = $author->link;
$context['author_share_buttons'] = $author_share_buttons;
}

$templates = ['author.twig', 'archive.twig'];
$page = new ListingPage($templates, $context);
$page->view();
new ListingPage($templates, $context);
1 change: 0 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
array_unshift($templates, 'all-posts.twig');

$page = new ListingPage($templates, $context);
$page->view();
} else {
Timber::render($templates, $context);
}
1 change: 1 addition & 0 deletions src/ListingPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function __construct(array $templates = [ 'archive.twig', 'index.twig' ],
$this->context = $context;

$this->update_context();
$this->view();
}

/**
Expand Down
3 changes: 1 addition & 2 deletions tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@
rewind_posts();

$templates = ['tag.twig', 'archive.twig', 'index.twig'];
$page = new ListingPage($templates, $context);
$page->view();
new ListingPage($templates, $context);
3 changes: 1 addition & 2 deletions taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@
$context['wp_title'] = $taxonomy->name;
$context['og_description'] = $taxonomy->description;

$page = new ListingPage($templates, $context);
$page->view();
new ListingPage($templates, $context);
1 change: 1 addition & 0 deletions templates/burger-menu-items.twig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
type="button"
data-bs-toggle="collapse"
data-bs-target="#menu-{{ targetId }}"
aria-label="Nav Link Button"
aria-expanded="false"
aria-controls="menu-{{ targetId }}"></button>
{% endif %}
Expand Down
1 change: 0 additions & 1 deletion templates/burger-menu.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{{ __( 'Close navigation mobile menu', 'planet4-master-theme' ) }}
</span>
</button>

<div class="burger-menu-header">
<a class="site-logo" href="{{ data_nav_bar.home_url }}">
{% include "blocks/site_logo.twig" %}
Expand Down

0 comments on commit c10af5b

Please sign in to comment.