WordPress.org

Ready to get started?Download WordPress

Forums

Magic Fields 2
calling the thumbnail? (10 posts)

  1. Kahil
    Member
    Posted 2 years ago #

    I've checked the website on how to do this, but it doesn't explain it. I'm using the image field that uses the wordpress media gallery. I see in the instructions that we can tell it to call the thumbnail, but it doesn't explain how to do so.

    How can I call the image's thumbnail size rather than the full size?

    http://wordpress.org/extend/plugins/magic-fields-2/

  2. PHPanos
    Member
    Posted 2 years ago #

    Post your code so that we can correct it. This IS documented in the wiki. Take your time reading it next time. Here's an example from the wiki:

    http://pastebin.com/gPk70erh

    Notice the comment: "for fields image type level but in accordance with the letter "o" to the original image or "t" for thumbnail"

    /PHPanos

  3. Kahil
    Member
    Posted 2 years ago #

    Yes, I've read the wiki over and over. Please update it so that it has better descriptions and so that it isn't broken randomly into two different languages. Makes it really difficult to follow and understand the examples.

    I used exactly what was in the wiki and when I do, it does what you say it will. As I am using duplicating groups, it does not work. It will only display the first image in the group and just repeat it.

    That whole section of the wiki is in another language, which makes it VERY difficult to understand the sample code does and how to implement things. As it is, I didn't see anything in the wiki that explains how to use the WordPress gallery image within repeated groups.

  4. PHPanos
    Member
    Posted 2 years ago #

    So you aren't talking about a magic field thumbnail? Do you need to be able to upload multiple image for one post, or just a single one? If the first option, I suppose you should use wordpress built-in function "wp_get_attachment_image()", if the later option you can use a featured image.

  5. Kahil
    Member
    Posted 2 years ago #

    no, i'm talking about the other option they provide to use the built in wordpress media gallery. i honestly think the magic field one is a waste of space. makes it so you can't manage the media you upload via the wordpress interface. it uploads the images to its own folder and has far less options/features.

    they should have just done it all with the wordpress media gallery.

    but yeah, it doesn't work in any use other than the most basic. I am just wanting to get it to show the thumbnail that links to the full size asset where the link can also have a rel of "lightbox". So yeah, I've had to do things differently and not use magic fields for this aspect.

  6. PHPanos
    Member
    Posted 2 years ago #

    But do you only need to be able to upload one single image per post, or multiple? There are different options depending on what you wanna do.

  7. Kahil
    Member
    Posted 2 years ago #

    the field would be in a group that can be duplicated, so it would be different multiple images. If I do that and duplicate the code, the other images never show up, only the first image repeated for each instance.

  8. PHPanos
    Member
    Posted 2 years ago #

    Could you post your code?

  9. Kahil
    Member
    Posted 2 years ago #

    Well, like I previously mentioned, I'm no longer using the same code. It doesn't work so I gave up trying to get it to. Now I'm doing it the old fashioned way for the media.

    But repeating it is pretty simple.

    Basically I created a new group called Media. There all I had was the WordPress image section and a text box where the image title would go. I then set up the template code so that I could call the image. I wanted to use two code snippets. One to call the thumbnail for displaying it in the template and one to use as the link target to show the full image. Pretty simple huh? Well, it doesn't work with repeatable groups. Even getting it to display the thumbnail from the wordpress gallery wasn't explained in the wiki and took me a lot of trial and error of messing with the code to get it to show the thumbnail and not the full asset. If I put it into the code for the repeatable group, each repeated group duplicates all the info except the thumbnail. The only thumbnail that is displayed is the first one, repeated in each duplicated group.

    Either it is a bug, it isn't explained in the wiki, or its just a limitation of the plugin. Either way it doesn't work.

  10. PHPanos
    Member
    Posted 2 years ago #

    I don't think magic fields has functions that deals with wordpress built-in gallery. I think those functions are made for their custom fields only.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic