Archived topic
When I remove post date the post catergory disapper!
1 reply · Started by Zsuzsanna on November 18, 2018
Hello David,
Firstly I would like to thanks all three for your fantastic support.
A lot of time I find the way to any issue, helping a lot!
But today I didn’t find…
I would like to remove the date post on archives and post blog but every time I deselect I loose the display post categories! (Customizing > Layout > Blog > Display post date)
So I want to have the meta post categories but not the date!
Any advice about that?
In advance thank you!
Johnny
LEO: So categories also disappear when you uncheck post date?
That’s very strange. Any chance you can link us to the site in question?
Feel free to open a new topic and use the private URL field.
Let me know
Yes I don't understand!
I have to tell you that I add a filter to mover category to title. I don't know if there is a connection!
------------------------------------------
// Move category close title
add_filter( 'generate_category_list_output','tu_remove_categories' );
function tu_remove_categories( $categories ) {
if ( is_home() || is_archive() ) {
return '';
}
return $categories;
}
add_action( 'generate_before_content','tu_cats_above_title' );
function tu_cats_above_title() {
if ( is_home() || is_archive() ) {
$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) );
if ( $categories_list ) {
printf( '<span class="entry-meta cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
_x( 'Categories', 'Used before category names.', 'generatepress' ),
$categories_list
);
}
}
}
------------------------------------------
In advance thanks,
Johnny
Hmm, those functions shouldn't cause that to happen.
Any other post meta related functions on the site?