Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archive templates #7

Open
justintadlock opened this issue Dec 1, 2016 · 2 comments
Open

Archive templates #7

justintadlock opened this issue Dec 1, 2016 · 2 comments

Comments

@justintadlock
Copy link

One of the main things I see as a "problem" from a purely development standpoint are the 5 different archive templates. Obviously, 4 of them are for specific plugins. However, there's really very little that's different with most of them. Personally, I'd strive to cut that down to a single archive.php template if possible.

Wrapper:

Primarily, this is the code that gets changed in each template:

echo '<div class="blog-wrapper">';

That's a lot of files for mostly just one change. I feel like a checathlon_loop_wrapper_class filter hook would do a better job.

Jetpack title/desc:

The next thing is the archive title and description with Jetpack. It really seems like Jetpack should handle this on its own, but I digress.

What'd I'd do is filter get_the_archive_title and get_the_archive_description to auto-add those Jetpack titles and descriptions in.


Of course, some devs prefer to have the templates and not too much going on over in functions.php, so it's your call. I dislike having too many top-level templates if they can be avoided.

@justintadlock
Copy link
Author

Now that I've dug more into the theme, I see that you're consolidating each plugin's archive-type pages into a single template.

@samikeijonen
Copy link
Owner

Now that I've dug more into the theme, I see that you're consolidating each plugin's archive-type pages into a single template.

Yes. I tried to avoid if else logic in archive.php if I remember correctly. But I think about if I could with just archive.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants