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

Undefined variable: post in homepages/templates/top-stories.php on line 73 #1723

Closed
benlk opened this issue Jun 10, 2019 · 4 comments
Closed
Assignees
Labels
Milestone

Comments

@benlk
Copy link
Collaborator

benlk commented Jun 10, 2019

With the "Top Stories" layout active, $post is undefined in several places on the homepage.

Screen Shot 2019-06-10 at 17 17 51

@benlk benlk added this to the 0.6.4 milestone Jun 10, 2019
@joshdarby
Copy link
Collaborator

@benlk Do you think we should we just change $post to the_ID() in this context, or actually make a $post variable?

largo_excerpt( $post, 3 );

@benlk
Copy link
Collaborator Author

benlk commented Jun 17, 2019

If possible, we should pass the WP_Post object to largo_excerpt rather than the post ID:

https://github.com/INN/largo/blob/37e7b9dbf3e40072fb15b9ebf25e81f73d20daef/inc/post-tags.php#L184-L198

@joshdarby
Copy link
Collaborator

@benlk So couldn't we just pass get_post instead of $post?

@benlk
Copy link
Collaborator Author

benlk commented Jun 17, 2019

Yeah, that looks like it would work.

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

No branches or pull requests

2 participants