Gutenberg: Post format does not work, displays all formats

Created on 5 Dec 2018  路  4Comments  路  Source: WordPress/gutenberg

Describe the bug
I am using FlatPro theme by Themeum. The post format select option lists all post formats and does not work while editing the post. There are no Console error.

Please help.

Expected Behavior
Gutenberg should list only those post formats which are defined in theme support.

Screenshots

Here is the screenshot link:

Desktop (please complete the following information):

  • OS: [e.g. MacOS ]
  • Browser [e.g. chrome, safari]
[Feature] Meta Boxes [Status] Duplicate

All 4 comments

Sounds like a duplicate of #12571.

Sounds like a duplicate of #12571.

Thanks a lot. I'll follow that.

Closing as a duplicate of #12571. Thanks @swissspidy!

We have solved this issue.

Add this code to the post-meta.js on the theme /flatpro/js/admin/post-meta.js

jQuery(document).ready(function($){ 'use strict';
/* Select Post Format /
$(document).on('change', 'select[id
="post-format"]', function(){
for (var i =0; i < $( '.editor-post-format select option').length; i++) {
var formate = $( '.editor-post-format select option:eq('+i+')' ).attr('value');
$('div[id^=post-meta-'+formate+']').hide();
}
var formate = $( '.editor-post-format select' ).attr('value');
$('div[id^=post-meta-'+formate+']').show();
});
/* End. */

$(window).load(function(){
for (var i =0; i < $( '.editor-post-format select option').length; i++ ) {
var formate = $( '.editor-post-format select option:eq('+i+')' ).attr('value');
$('div[id^=post-meta-'+formate+']').hide();
}
var formate = $( '.editor-post-format select' ).attr('value');
$('div[id^=post-meta-'+formate+']').show();
});
/* End on load. */

});

Thanks a lot.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maddisondesigns picture maddisondesigns  路  3Comments

jasmussen picture jasmussen  路  3Comments

jasmussen picture jasmussen  路  3Comments

davidsword picture davidsword  路  3Comments

ellatrix picture ellatrix  路  3Comments