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

Fix for Undefined variable $post in homepage/templates/top-stories.php #1728

Merged

Conversation

joshdarby
Copy link
Collaborator

For #1723, if the Top Stories layout was active,
Notice: Undefined variable: post in .../wp-content/themes/largo-dev/homepages/templates/top-stories.php on line 73
would be returned since $post is undefined.

Switched largo_excerpt( $post, 3 ); to largo_excerpt( get_post(), 3 ); to fix the issue.

@joshdarby joshdarby requested a review from benlk June 17, 2019 16:33
@joshdarby joshdarby added this to the 0.6.4 milestone Jun 17, 2019
@benlk
Copy link
Collaborator

benlk commented Jun 17, 2019

This patch is good, but I found a similar problem:

Notice: Undefined variable: post in wp-content/themes/largo/homepages/templates/top-stories.php on line 32

It looks like there's one more instance of $post in this file that can be changed while we're in here.

https://github.com/INN/largo/blob/5fd6472b90da2e3a44d9b90ce9dfa00b0bf95855/homepages/templates/top-stories.php#L26-L32

Should that be handled in a separate PR, or in this one? I'm in favor of doing it in this PR, but if it makes more sense to you to do this in a separate PR then let's do that.

@joshdarby
Copy link
Collaborator Author

Should that be handled in a separate PR, or in this one? I'm in favor of doing it in this PR, but if it makes more sense to you to do this in a separate PR then let's do that.

@benlk I think it's fine to handle in this PR since the title of it is just
Fix for Undefined variable $post in homepage/templates/top-stories.php
instead of specifying a line number that was fixed.

@joshdarby
Copy link
Collaborator Author

@benlk Does this look good to merge now?

@benlk benlk self-requested a review June 18, 2019 13:59
@benlk
Copy link
Collaborator

benlk commented Jun 18, 2019

Yep!

@joshdarby joshdarby merged commit 0022f88 into 0.5-dev Jun 18, 2019
@benlk benlk deleted the 1723-undefined-variable-post-in-homepage-top-stories branch June 18, 2019 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants