[BUG] Selected category option is not visible on frontend post
Closed this issue · 2 comments
Rubaiyat-E-Mohammad commented
Description: Selecting a category option while filling up a form is working fine. But the selected option is not reflecting on the published post from frontend
Steps:
- Create a post from including category option selection field
- Publish the form and create a post from frontend
- Publish the post and observe that the selected category option is not reflecting on the post
More details and reference video in slack Thread
sapayth commented
categories and meta fields are not the same. so we can’t treat them the same way. there should be some theme options to show the categories. if the user needs to show them in the content body, here is a basic way:
add_filter( 'the_content', 'astra_show_categories' );
function astra_show_categories( $content ) {
if ( ! is_single() ) {
return $content;
}
$categories_list = get_the_category_list( esc_html__( ', ', 'theme-text-domain' ) );
if ( $categories_list ) {
$content .= 'Categories: ' . $categories_list;
}
return $content;
}
Rubaiyat-E-Mohammad commented
Not an issue. Fixed in client site.