Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey vabmedia!
    I’m also trying to figure this out. Shall we both post our findings here? Good luck!

    Thread Starter vabmedia

    (@vabmedia)

    Hi DeepTitanic,

    I saw that the Options Framework People posted a tutorial on their site on how to set up metaboxes: https://wptheming.com/2010/08/custom-metabox-for-post-type/

    And I’ve seen similar examples elsewhere also. I’ll be trying it this weekend. Will let you know how it works ??

    Start with the example code inside the plug-in and learn from that and try to create more advance metaboxes later on.

    Thread Starter vabmedia

    (@vabmedia)

    Yes, I figured it out, just using the examples was enough. I also had a custom post type that I was adding meta boxes to, and needed to identify that in page=> “custom-post-type”
    If you just had a regular post you would do page=>post

    I also contacted the developer of the plugin he was really nice and helpful.

    What happened though, was for some strange reason, it wasn’t pulling up the meta boxes no matter how many times I went in and revised everything. Finally, what I did was that I changed the actual file name from meta-boxes.php to peru-meta-boxes.php and the meta boxes finally showed up.

    Weird, right?

    The instructions in the documentation were all right, except for just naming my file the standard “meta-boxes.php” didn’t work, and when I renamed the file, it worked. Go figure – it’s always the simplest thing that you overlook.

    Thread Starter vabmedia

    (@vabmedia)

    Ok, so after I got the metaboxes to work, I tried pulling my images using Ot_get_option(‘metabox-option-name’) and It echoed back metabox-option-name. I was trying to get the image url from the upload meta box option.

    This pulled the urls, but didn’t pull the image:
    $attachments = get_children( array(
    ‘post_parent’ => get_the_ID(),
    ‘post_type’ => ‘attachment’,
    ‘numberposts’ => 1, // show all -1
    ‘post_status’ => ‘inherit’,
    ‘post_mime_type’ => ‘image’,
    ‘order’ => ‘ASC’,
    ‘orderby’ => ‘menu_order ASC’
    ) );
    foreach ( $attachments as $attachment_id => $attachment ) {
    echo wp_get_attachment_image( $attachment_id );
    }

    So …now I need to pull each image one by one. How do I do that?

    Yes, the same problem;

    I changed the actual file name from meta-boxes.php to xxxx-meta-boxes.php and the meta boxes finally showed up.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: OptionTree] don't know how to use meta boxes’ is closed to new replies.