upload image and use it in plugin - wordpress

I am developing a wordpress plugin and I have a problem with image uploading. I need do something like what a custom-header contain where I can upload image and use it. I try to use http://goo.gl/JHna9 It upload image successfully but I need something more. I need to find out way how tell to wordpress that uploaded picture was for my plugin and next get all pictures uploaded through my plugin.
Any ideas?
Thanks

you have several choices.
Use the same upload function to create a DB entry (But I would not reccomand it if it is not absolutely neccessary)
use the same function you are uploading to create a hidden custom field - associating it somehow (with a key) to your plugin (after all - an attachment is only a taxonomy for some kind of post - and has it´s own metadata. )
put your attachments in a different folder (can be usefull - depending on what you want to do)

Related

How to remove a WordPress page from a path?

I have a site that was made in WordPress and I need to remake it just with HTML and php.
The problem is
I have a page at the url www.mydomain.com/create
I created a new file with same name, www.mydomain.com/create.php
Now on the host I removed the extension .php, but the problem is i will still hit the word press page.
Where can I find the file with the url set for this page? I don't know much about word press besides where plugins are.
WordPress does not use one file per page / post. WordPress instead has a template system inside themes that defines how pages and lists of posts are turned into HTML. The content of those pages and posts resides within the database and can be viewed in wp-admin. Further, WordPress extensions and themes can define hook functions and filters to modify content and style of the page and execute code upon certain events.
You cannot find a file for this "/create/" page. It has some content in the database but the content itself won't render into what you see in the browser.
Sorry to say this, but if you like to recreate the site, you will have to find a new way of constructing and rendering it (and also reusing code). You might also want to look for a proper framework like Laravel and have some proper routing in place (instead of renaming PHP files).
Edit:
You can change the permalink for create like so:
UPDATE PREFIX_posts SET post_name = 'create_old' WHERE post_name = 'create';
You have to adapt the MySQL table name to the WP posts table by replacing PREFIX with whatever prefix your WP posts table has.

Is it possible to create a post from an NextGen Gallery image? [WORDPRESS]

I have uploaded many pictures, and I would like to create a new post for each of them with a specific category named photos and a custom field url with the url of the image.
Is that possible ?
I imagine a button Create Post in the NextGen interface next to View / Edit / Delete links
Do you know if there are a plugin or something like that ?
You don't need a plugin for this.
Create a New Post
Set type to image
Upload the image here from NextGEN if required
Specify Category as photos
Add url of the image into custom field
Done
This has a lot of advantages, allowing you to perform all operations available to posts by default like searches.
See screenshot of how I set it up.
Cheers

How to make quick edits to images uploaded to media library

When I have images uploaded to Wordpress, there is no way for me to flexibly edit these images. For example, let's say I want to add a colored overlay over an image that has been uploaded to Wordpress. For me to do this, I have to add the overlay to the image, then upload the new modified image to Wordpress. When I am developing a non-Wordpress site, however, all I have to do is link to the photo in the CSS, then using the Image Assets generator, the linked image is changed on the fly. This saves me from having to re-upload photos every time I make a change.
Is there any Photoshop script or plugin, or just a method in general for editing photos without having to re-upload them to Wordpress?
There isn't any script out there that I know of, but if you have access to the wordpress uploads directory via an ftp client, you can edit the originally uploaded file and then use a plugin like Regenerate Thumbnails to update the smaller and automatically generated images.

Creating wallpaper website site in wordpress

I'm trying to create a wallpapers site, using WordPress platform. The website should have similar functions like this wallpapers site. Which plugin is required to re-size images in multiple sizes, like 1920x1200, or 1920x1080. If there's no such plugin, how can I create this function in WordPress?
You have two options for this:
Manual: Uploaded images can be edited and cropped to the required size by teh administrator. Go to the media library, find the image, click edit and make the changes necessary
Automatic: I found this page by typing "how to edit image size in wordpress" when I was, in fact, looking for a manual that would explain with screenshots the instructions in step 1 above: http://www.wpbeginner.com/wp-tutorials/how-to-create-additional-image-sizes-in-wordpress/
The post there makes use of the add_image_size function of Wordpress and tells Wordpress to automatically generate thumbnails in your required size.
Creating a Wallpaper website in WordPress is now as easy as counting 1-2-3. All you need a WordPress + decent hosting and a Wallpaper WordPress theme from https://binarynote.com
Just install Wallpaper WordPress theme along with their bulk image uploader plugin and you are ready to upload your wallpapers. The theme is able to generate different image sizes like you have mentioned automatically but will not store any such images on your server.
here is one such theme for your ready reference. https://binarynote.com/wordpress-theme-wallpaper.html
Hope this will help you a lot.

Wordpress: Different Image Rotator on every page

The situation:
Wordpress based website for Veterinarian clinic
Image rotator on frontpage, separate header image attached to every page
The desired situation:
Image rotator with several images on every page
Currently it is possible to couple several images with a page, in the backend they are shown in the "Gallery". I would like to show these images in the rotator.
Before I engage in writing my own plugin to do this my question:
Is there a plugin available that can rotate several images on every page?
There are a few ways to do this.
Using your current image rotator, you can create templates for your new pages (page-your-slug.php) and add different images to the rotator on each template file. These are created it your theme folder. Read more here.
Second option is to use the is_page() function. Using that you can write and if statement to display the different images. if(is_page('your_page')) { images }, rinse and repeat.
3rd option is assuming that you want this to be more dynamic and changeable. Install the attachments plugin. this will allow you to upload a variety of images to each page (or post), which you can then loop through in your slider - this method is probably the best.
Hope this helps.

Resources