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 theme support for post formats #295

Merged
merged 9 commits into from
Sep 27, 2024
Merged

Add theme support for post formats #295

merged 9 commits into from
Sep 27, 2024

Conversation

carolinan
Copy link
Contributor

@carolinan carolinan commented Sep 13, 2024

Description
I have re-opened this PR after the discussion in #17
If we want the theme to have partial support for post formats in 6.7, it needs to be added to the theme before Beta 1, since it is an enhancement. Then if it does not work well enough, it can be removed before the string freeze.

This PR:

  • Registers theme support for the formats that are listed in Figma: gallery, quote, link, audio, video
  • Adds the HTML archive template for the "link" post format.

Testing Instructions

This can be tested with the latest version of Gutenberg active.

  1. Set the permalinks on the test installation to anything but plain which does not seem to work.
  2. Create one or more posts and assign the "link" post format.
  3. View the archive on the front: Add type/link/after your test domain in the browser address bar.
  4. Confirm that the query loop shows the correct posts.

@carolinan carolinan closed this Sep 22, 2024
@carolinan carolinan reopened this Sep 25, 2024
@carolinan carolinan changed the title Post format experiment, do not merge Add theme support for post formats Sep 25, 2024
@carolinan carolinan added the [Type] Enhancement A suggestion for improvement. label Sep 25, 2024
@carolinan carolinan marked this pull request as ready for review September 25, 2024 12:52
Copy link

github-actions bot commented Sep 25, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: carolinan <[email protected]>
Co-authored-by: juanfra <[email protected]>
Co-authored-by: jasmussen <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

github-actions bot commented Sep 25, 2024

Preview changes

You can preview these changes by following the link below:

I will update this comment with the latest preview links as you push more changes to this PR.
⚠️ Note: The preview sites are created using WordPress Playground. You can add content, edit settings, and test the themes as you would on a real site, but please note that changes are not saved between sessions.

Copy link
Member

@juanfra juanfra left a comment

Choose a reason for hiding this comment

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

Thanks Carolina, so the idea is to squeeze it in before beta 1 in case we can make it for 6.7. Right?

functions.php Outdated
* @since Twenty Twenty-Five 1.0
* @return void
*/
function twentytwentyfive_post_format_setup() {
Copy link
Member

Choose a reason for hiding this comment

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

Let's wrap this in an if ( ! function_exists(... like the other functions in the file.

templates/taxonomy-post_format-post-format-link.html Outdated Show resolved Hide resolved
templates/taxonomy-post_format-post-format-link.html Outdated Show resolved Hide resolved
@carolinan
Copy link
Contributor Author

Thanks Carolina, so the idea is to squeeze it in before beta 1 in case we can make it for 6.7. Right?

I do not believe there is enough support or developers available, but, yes.

@jasmussen
Copy link
Contributor

Appreciate this PR.

Do we need additional templates or is this ready to land?

@carolinan
Copy link
Contributor Author

There should be archive templates for each supported format.

And possibly for the singles. The good thing is there are Figma designs for the singles.

@jasmussen
Copy link
Contributor

I'll see if I can do anything to help here.

@jasmussen
Copy link
Contributor

Following up, I created #441 with a summary of some learnings.

One path forward I can see is: we register these formats, but we don't add templates for them. And we create a few patterns for the slightly more elaborate formats, Link and Audio. Let me know your thoughts.

@carolinan
Copy link
Contributor Author

  • I removed the HTML template
  • Wrapped the theme_support in function exists
  • Added the image post format - We did not discuss this, but I think it will be requested by users.

@jasmussen jasmussen self-requested a review September 27, 2024 13:36
Copy link
Contributor

@jasmussen jasmussen left a comment

Choose a reason for hiding this comment

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

This feels worth trying, and it will be easier to rewind if we need to, than add at a later time.

@carolinan carolinan merged commit 91f1627 into trunk Sep 27, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants