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

Featured image for custom front page is not showing! #17

Open
eagleyed opened this issue Jun 6, 2018 · 0 comments
Open

Featured image for custom front page is not showing! #17

eagleyed opened this issue Jun 6, 2018 · 0 comments

Comments

@eagleyed
Copy link

eagleyed commented Jun 6, 2018

I was testing amp-theme-framework and very first bug I noticed is that featured image for custom page is not working. For other pages it works

I have found the source of the issue and may be it will help you guys to fix this.

  1. featured-image.php
    Line no - 23

if( true == ampforwp_has_post_thumbnail()){}
// It's always false because of (2) so featured image don't show up.

  1. features.php
    Line no - 10599

if(has_post_thumbnail()){ return true; }
// has_post_thumbnail() is false, somehow global $post is not working here.

workaround

Adding an arg $post_id to the function ampforwp_has_post_thumbnail will fix this.

function ampforwp_has_post_thumbnail($post_id){ global $post, $redux_builder_amp; if(has_post_thumbnail($post_id)){ return true; } ...

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

1 participant