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 images to your Article Schema throws fatal error #308

Open
2 tasks done
shabnam611 opened this issue Jun 22, 2024 · 1 comment
Open
2 tasks done

Add images to your Article Schema throws fatal error #308

shabnam611 opened this issue Jun 22, 2024 · 1 comment

Comments

@shabnam611
Copy link

shabnam611 commented Jun 22, 2024

Please give us a description of the issue

When I use the filter wpseo_schema_article and use the example code provided here, I see fatal error.

Steps to replicate:

  1. I used the code snippet plugin to add the example code.
  2. Changed the value of $attachment_id in the example. I added an image and used the ID for that image
  3. Then I saved the code and activated it.
  4. I checked a post where I set schema type as webpage and page type as article. I noticed fatal error in the page source that says: WPSEO_Schema_Image is not found.

Screenshot:
Screenshot 2024-06-22 at 4 02 34 PM

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.
@mhkuu
Copy link
Contributor

mhkuu commented Sep 6, 2024

Good call! Yeah, that should probably use the generate_from_attachment_id function instead, as referenced below the code snippet. I will test that and update the snippet later.

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

2 participants