Import images and files
-
Hello,
1. How to import multiple images if inside the “post” picture is set as [pic2] [pic3] [pic4] etc…
While the pictures itself are 1.jpg,2.jpg,3.jpg.
So how to make that 2.jpg is attached/showed in post if [pic2] is inside the post?
2. Also, how to attach to the post if any of the documents is find inside the “documents node in pdf,doc format”?
Example node is “documents=1.pdf,2.doc”, how to import them to the post if it’s found in the node itself?
-
Hi @ivanko12,
How to import multiple images if inside the “post” picture is set as [pic2] [pic3] [pic4] etc… While the pictures itself are 1.jpg,2.jpg,3.jpg. So how to make that 2.jpg is attached/showed in post if [pic2] is inside the post?
Can you please show me a screenshot of this data so I can fully understand what you’re talking about?
Also, how to attach to the post if any of the documents is find inside the “documents node in pdf,doc format”? Example node is “documents=1.pdf,2.doc”, how to import them to the post if it’s found in the node itself?
You can import PDF/doc files via the Other Post Options ? Download & Import Attachments field: https://d.pr/HPgDPy.
Hey,
I’ll try to explain more
For example, this is the post:
And this is the data of the images being imported(node):
“Images = img_3019.jpg,img_3036.jpg,img_3039.jpg”
While he does download the images and import them in the media/gallery, and put the first picture as “featured image”, I want that the rest of the pictures are also in the post under where it says “[pic1] [pic2]” so [pic1] = img_3019.jpg, [pic2] = img_3036.jpg and [pic3]= img_3039.jpg and show them on the appropriate location. And that’s like with every post, it starts from pic1 to picxxx, it’s not continuation that the first image in the second post is “[pic4]” but it’s again “[pic1]”
—————————
As for the documents, the same thing, it does import them, but they are not inside the post and needs manual work to show them in the post.From the first screenshot, you have the same example, “[doc1]”. I want that the document which was in the node
Documents = “aaa.docx”, “bbb.docx”, “ccc.pdf” shows in post where is [doc1] [doc2] [doc3].
So, same thing like with the pictures.
—————————
Another thing is that if I use [gallery] on the end of the post, it will show the featured image in the gallery as well, can that somehow be skipped, so it shows only from the second picture, as the first picture is used just for the “featured” image which is not needed in the gallery.Thanks!
Hi @ivanko12,
I want that the rest of the pictures are also in the post under where it says “[pic1] [pic2]” so [pic1] = img_3019.jpg, [pic2] = img_3036.jpg and [pic3]= img_3039.jpg and show them on the appropriate location. And that’s like with every post, it starts from pic1 to picxxx, it’s not continuation that the first image in the second post is “[pic4]” but it’s again “[pic1]”
Thank you for clarifying.
It sounds like you’re wanting these to be custom shortcodes that fetch and display the images. That’s not something you’d be able to set up with our plugin, you’d have to custom code the shortcodes with the shortcode API: https://codex.www.ads-software.com/Shortcode_API. Note that you could use the pmxi_gallery_image hook to store the image information in a custom field that your shortcode can fetch: https://www.wpallimport.com/documentation/action-reference/#pmxi_gallery_image.
As for the documents, the same thing, it does import them, but they are not inside the post and needs manual work to show them in the post.
You’d have to write custom code that updates the content to display the documents, or write another custom shortcode. Here’s an example that you can modify as needed: https://d.pr/D8nr7L.
Another thing is that if I use [gallery] on the end of the post, it will show the featured image in the gallery as well, can that somehow be skipped, so it shows only from the second picture, as the first picture is used just for the “featured” image which is not needed in the gallery.
Unfortunately, I’m not aware of a way to do that with the gallery shortcode since you won’t know the ID of the featured image beforehand. You’d have to write a custom shortcode for this as well.
Hey,
Thanks for the info.
I would need one more assistance about this https://d.pr/D8nr7L
1. This is showing “Download filename.pdf” is there anyhow possible to import the “title” as well and instead of “Download filename.pdf” it shows the title.
Title is formatted same as data, for example:
documentfiles=”First.pdf,Second.pdf,Third.doc
documenttitles=’FirstFile,SecondFile,ThirdFile’So what I want, instead of First.pdf, it writes from documentttiles which FirstFile etc…
My guess is this part $value, but no idea how to do the whole steps to get that?
$output .= ‘Download ‘ . $value . ‘<br>’;
2. Files which are inside “/wp-content/uploads/wpallimport/files” have the original date, I would like that to stay when the plugin imports them so it’s not “today” when it’s imported, and then if possible when they show on the website, they are ordered by the date and maybe it shows the date of the upload, as there can be many files inside of the post and they are uploaded on different Dates/Years.
- This reply was modified 2 years ago by ivanko12.
Hi @ivanko12,
So what I want, instead of First.pdf, it writes from documentttiles which FirstFile etc…
My guess is this part $value, but no idea how to do the whole steps to get that?
Yes, you’d have to replace $value to get the title. I haven’t tested it, but something like this should work:
get_the_title( $key )
Files which are inside “/wp-content/uploads/wpallimport/files” have the original date, I would like that to stay when the plugin imports them so it’s not “today” when it’s imported, and then if possible when they show on the website, they are ordered by the date and maybe it shows the date of the upload, as there can be many files inside of the post and they are uploaded on different Dates/Years.
The files from /files/ have to be imported into the Media Library, which is why the date changes. You’d have to write more code to modify the dates and order by date, which we unfortunately cannot help with.
- This reply was modified 1 year, 12 months ago by WP All Import.
Hey,
Thanks.
If I use get_the_title( $key ), how to loop through “documenttitles=xxx,xxx,xxx” in order to import it into key?
Regards.
Hey @ivanko12,
Unfortunately, we aren’t able to help with custom code solutions in this forum, but we can leave this thread open for a bit to see if anyone is willing to help out.
Hello,
Understandable, if I have standalone import premium and reach out to you through email, will I get the exact way/code how to do it?
Thanks.
Hey @ivanko12,
if I have standalone import premium and reach out to you through email, will I get the exact way/code how to do it?
Unfortunately, no, we aren’t able to write custom code for your project as part of our support. If you have any other questions about our premium plugins, please direct them here: https://www.wpallimport.com/support/. We can only answer questions about our free plugins in this forum.
Just a quick update here.
I was able to do it, but it wasn’t smart to have “titles” in one row separated by “comma” as there can be multiple commas for the Title, but you can use any other separator then, example: “|”
I have set that my Titles are “CustomField” as “_DocumentTitle” and then passed the whole node into it, after that this is the shortcode:https://pastebin.com/TN83tw0q
While the solution is solid, the way that you need to use “shortcode” to see the attachment in the post is just weird, because you can’t edit anything and they are stuck there forever.
My suggestion for the plugin in the future is that it handles attachment somehow normal and insert into the post <a href> link and have possibility for the Titles as well, so anyone can later edit it in normal page/post.
In the end, I had to create manual script which will update every page/post and add <a href> link inside so anyone can later edit it or manipulate.As for the gallery and the first image = featured image. I simply did just “update” the post through API, after that, inside the database shortcode changed from [gallery file] to [gallery file=123,4325,1231], and with the loop removed the first value from gallery file inside the database and that did the trick.
You may close the thread.
- The topic ‘Import images and files’ is closed to new replies.