Skip to content

Instantly share code, notes, and snippets.

@paaljoachim
Last active April 16, 2022 14:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paaljoachim/2adcc2fc7eae059d5be47a4ccb77aa86 to your computer and use it in GitHub Desktop.
Save paaljoachim/2adcc2fc7eae059d5be47a4ccb77aa86 to your computer and use it in GitHub Desktop.
Featured image for Genesis themes. 1. Sets the featured image. 2. If no featured image get image from category. 3. If no category image then get the first post image. 4. If no post image or category image then sets a fallback image.
@paaljoachim
Copy link
Author

paaljoachim commented Jul 2, 2016

This code feels more robust and works better then the general featured image snippet: https://gist.github.com/paaljoachim/857644243e033668101615e14d85bb69

It also has link directly to image url instead of attachment id.

What I want to do is add code to the Genesis snippet so that it can be added to a functions file for most themes not just Genesis themes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment