• I am developing a theme to be shared in the WP theme directory, adding post formats support, would be valid to have:
    – template file content-video.php with just the main loop to show contents.
    – The following code in functions.php:

    function themeName_setup() {
        add_theme_support(
            'post-formats',
            array(
                'aside',
                'image',
                'link',
                'quote',
                'status',
                'video'
            )
        );
    
        add_action('init', 'themeName_post_type_init');
        function themeName_post_type_init() {
            add_post_type_support(
                'post-formats',
                array(
                    'aside',
                    'image',
                    'link',
                    'quote',
                    'status',
                    'video'
                )
            );
        }
    }
    add_action( 'after_setup_theme', 'themeName_setup' );
    
    function themeName_content_width() {
        if(
            is_page_template( 'page-templates/full-width.php' ) ||
            is_attachment() ||
            ! is_active_sidebar( 'sidebar-1' ) ||
            has_post_format( 'video' )
        ) {
            global $content_width;
            $content_width = 960;
        }
    }
    add_action( 'template_redirect', 'themeName_content_width' );

    Thanks for help.

  • The topic ‘post format video’ is closed to new replies.