0

I wanted to add meta box with current post format like when i select video post format then there will be appear video url input post just under the post editor. How to do that? any help

  • What's the 'current' post format? – Dave Romsey Nov 30 '16 at 20:01
  • like when i select video post format, then there will be appear video url meta box down the editor box – nriddhi Dec 1 '16 at 10:55
1

If you want it just for the native post post type, then put this in your functions.php

add_action('init', 'my_theme_setup');
function my_theme_setup(){
    add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
}

The Post Format meta box will now appear down the side of your screen on the post creating/editing page.

Full list of available post formats to pass into the add_theme_support function - https://codex.wordpress.org/Post_Formats

|improve this answer|||||
  • I wanted to add meta box with current post format like when i select video post format then there will be appear video url input post just under the post editor – nriddhi Dec 1 '16 at 10:58
  • 1
    Oh ok. This is going to require JS/AJAX. I suggest first installing the Advanced Custom Fields plugin - advancedcustomfields.com, and if you don't want to use a third-party plugin, then look at it's code to get a head start. – Dan. Dec 1 '16 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.