Support » Fixing WordPress » Adding link while automatically uploading and linking to page?

  • Resolved bergfalke1


    Hello guys,
    my first post here, so please be gentle :*
    I’m trying to ease my work. I am porting a webpage out of web 1.0 times into wordpress. For some thing, I have not quite worked out how to do that effectively yet.
    Specifically, I want to be able to link to a file (either jpg or pdf) within a text-list. That file should optimally be then selected from my local computer, uploaded into my media library, attached to the page I’m editing and then be linked. I guess, I need a plugin for that, don’t I?

    Or am I doing something wrong? Right now, I do it like this: Media Library, Add New, select the File and upload it, go into the details of the file, copy the permalink, switch to the page I’m editing, add a hyperlink and insert the permalink. That can’t possibly be the most effective method?

    Thanks for your input!

    • This topic was modified 3 months, 2 weeks ago by Jan Dembowski.
Viewing 5 replies - 1 through 5 (of 5 total)
  • You are doing it the hard way, and no you don’t need a plugin for this.

    Edit or write the post first. While in the editor, add the image (this part is specific to which editor you are using) and the upload dialog will show. Drag your file to it or select from the upload control, and the file will be uploaded. You have the option for linking or not along with size. Click on Insert, and you are back in the post with the file there (and linked).

    As for the difference in editors: the classic editor (or classic block in block editor) has the Add Media button and a slightly different flow to the newer block editor. The block editor has an Inserter for blocks (choose Image block or Media/Text block or Gallery block or others) and it will take you into the media flow to select or upload the files. Additionally, you can have an inline image in a paragraph block and it’s an icon on the toolbar.

    When you add the media first, it is not attached to any post.
    When you are in a post and add the media, it is attached to that post.
    This is only relevant for gallery shortcodes with no parameters or some plugins that do things with attachments.

    Hello Joy, thank you for the answer. Sorry for not clarifying enough. I use the Gutenberg editor. The thing is, I am already in a block. I have a bulleted list, and in every line, I want a part of the text to hyperlink to either a pdf or an image. So, when using the method you suggested, I would have to add a new block. I tested this, added a file block, uploaded the file, then copied the link, added a hyperlink to my list and deleted the file block again. It makes it a little bit easier, as I don’t need to switch to the media library, thank you for that. But it is not yet the optimal solution, as I would like to have a possibility to upload a file when adding a hyperlink to an existing block. Maybe there’s a plugin that can do that?

    So you want to add a link to a file but not show that file?
    That is out of the ordinary. I suppose there might be a plugin to help with links to files that aren’t shown. You have heard of using two windows at a time, right?

    Yes, I already figured out that you can keep several tabs of different wordpress areas open at once. Thought so, thank you for the answers 🙂

    I just wanted to add, that it is indeed helpful to make a /file-block with Gutenberg and just copy the link that it gives you into the list. You can replace the items as well and delete the block when you’re done. This has saved me some time. I’ll mark this a resolved, thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.