• Hi! I’m wondering if someone knows how (or if it’s possible) to add media to a page without using the “Add Media” button, but using code instead.

    I need to add a row of five images to a page and center them, but for some reason I keep running into problems, and the images either spill over onto a second row or I have to make them tiny to all fit on one row. Here’s the page: https://ampedforeducation.org/about-us/. I recently used a plugin (WordPress Colorbox) that allowed me to add and center four large images in a row without any issues using code, so I’m thinking that adding images that way would help solve my problem. Here’s the page using Colorbox: https://ampedforeducation.org/home/about/who-we-are/. If I tried to add those same images with the “Add Media” button they would never fit on one row.

    Let me know if any of this needs clarification!

    Sarah

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Sarah,

    You can always resize images manually to make them fit in one row.

    Colorbox is laso a good options. There are other image/gallery plugins available in WordPress Plugins Archive.

    Have you tried to upload images using Dashboard>Media option

    Thread Starter sjwormann

    (@sjwormann)

    Thanks for the response! When I resize images manually, I can keep them on one row but then they are too small and aren’t centered. I really need to be able to center the images and keep them all on one row, but when I manually resize and center them it looks like this: https://ampedforeducation.org/wp-content/uploads/2015/02/Screen-Shot-2015-02-04-at-1.16.18-PM.png

    Hi Sarah,

    Looking at the page you provided and the screenshot of the page you’re trying to create, my first idea is that some of the automatically created code may be in the wrong place.

    There are a couple of things I’d like to recommend to start addressing this:

    1. First of all, instead of resizing the images in the WordPress interface, I would recommend doing so on your computer, saving the smaller images as a separate file, and then uploading those images to WordPress. There are a number of reasons why this is better for your site, but in this case, it’s one less piece of code getting created by the system that might inadvertently confuse it.

    2. You mentioned that you “manually resized and centered the images.” I don’t know how familiar you are with HTML, but if you click on the “Text” tab (on the upper right side of the content box) of the editor for the page shown in the screenshot, how many times do you see these tags: <center></center>?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding media to a page with code’ is closed to new replies.