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

Add classes for the category and tags to the primary <section> #767

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

laurelfulford
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR adds a post's category and tag classes to the primary <section> tag of single posts. This lets us add styles for just posts in one category or tag.

These are already on the <article> tag (along with some of WordPress's other standard classes), but the way I structured the single posts means the title is outside of the <article>. Ideally this will be refactored in the near future, but this will help for the near term.

How to test the changes in this Pull Request:

  1. Apply the PR.
  2. View a post with both tags and categories; confirm they're being added as classes to the <section> tag with the primary ID, prefaced with category- or tag- -- something like:
    <section id="primary" class="content-area category-entertainment category-featured tag-testing-things tag-wondering">
  3. Test the same with the One Column template.
  4. Test the same with the One Column Wide template.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@laurelfulford laurelfulford added [Status] Needs Review The issue or pull request needs to be reviewed Smaller PR This PR is smaller and quick to test. labels Feb 11, 2020
Copy link
Contributor

@claudiulodro claudiulodro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great. Clever solution. 👍

@claudiulodro claudiulodro added [Status] Approved The pull request has been reviewed and is ready to merge and removed Smaller PR This PR is smaller and quick to test. [Status] Needs Review The issue or pull request needs to be reviewed labels Feb 11, 2020
@laurelfulford
Copy link
Contributor Author

Thanks!

@laurelfulford laurelfulford merged commit 263cd02 into master Feb 11, 2020
@laurelfulford laurelfulford deleted the adds/category branch February 11, 2020 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants