Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Derek Herman

    (@valendesigns)

    What do you mean specific size? Can you give more information.

    Thread Starter humayun288

    (@humayun288)

    When I upload a logo for Header logo using OptionTree framework it uploaded original size But I wanted a client can upload any size of logo but it will crop a certain size. I wanted to add any option for crop image by using OptionTree.

    Plugin Author Derek Herman

    (@valendesigns)

    Have you considered saving the logo as an attachment ID instead of a url? Then you could add an image size to your theme and force WP to crop it for you.

    Thread Starter humayun288

    (@humayun288)

    Actually, I used below code –

    <?php
    $header_logo = ot_get_option(‘headerlogo’);
    ?>

    and

    <?php if($header_logo): ?>
    “><span><img src=”<?php echo $header_logo; ?>” alt=””></span>
    <?php endif; ?>
    —-
    I could not understand how do I add attachment ID? Could you please help me?

    Plugin Author Derek Herman

    (@valendesigns)

    This is pulled from the Option Tree theme and demonstrates how to save the upload option type as an attachment ID. Which is by adding a class of ot-upload-attachment-id to the array.

    array(
      'id'          => 'demo_upload_attachment_id',
      'label'       => __( 'Upload Attachment ID', 'option-tree-theme' ),
      'desc'        => sprintf( __( 'The Upload option type can also be saved as an attachment ID by adding %s to the class attribute.', 'option-tree-theme' ), '<code>ot-upload-attachment-id</code>' ),
      'std'         => '',
      'type'        => 'upload',
      'section'     => 'option_types',
      'rows'        => '',
      'post_type'   => '',
      'taxonomy'    => '',
      'min_max_step'=> '',
      'class'       => 'ot-upload-attachment-id',
      'condition'   => '',
      'operator'    => 'and'
    )
    Thread Starter humayun288

    (@humayun288)

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Header logo (Specific size)’ is closed to new replies.