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

Unattached images #16

Open
pixedelic opened this issue Sep 21, 2015 · 2 comments
Open

Unattached images #16

pixedelic opened this issue Sep 21, 2015 · 2 comments

Comments

@pixedelic
Copy link

Hi, great plugin!

Is there any way to use it with non-attached images? I would like to use the plugin with placeholders as well, if possible.

TIA, Manuel :-)

@eoutvik
Copy link
Contributor

eoutvik commented Sep 22, 2015

Hi Manuel

The plugin hooks on to the following Wordpress functions:

wp_get_attachment_image_src
wp_get_attachment_image
the_post_thumbnail
get_the_post_thumbnail

wich all require the image to be added to the post or media section i Wordpress. You would have to add the images you want to use as placeholders to the media section and insert them using something like

wp_get_attachment_image(MEDIAID, array(500,500) );

@pixedelic
Copy link
Author

Thank you, in facts I'm using media_sideload_image() to upload a placeholder when the theme is installed for the first time and a custom function to get the ID of the just uploaded placeholder from the the db, after that. But I was wondering if there was a fastest way, in particular because the custom function to retrieve the ID is not a core function. However doesn't matter, thank you for the reply :-)

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