Archived topic
Remove Featured Column from single category
6 replies · Started by dave on January 28, 2022
Hello,
I am trying to stop the first post from being featured on one of my category archives https://heliafitness.com/category/success-stories/
I'm trying this code but I must have something wrong as it doesn't seem to be working. Thank you for your help.
add_filter( 'option_generate_blog_settings', 'lh_disable_featured_column' );
function lh_disable_featured_column( $options ) {
if ( ! is_category( 'success stories' )() ) {
$options['featured_column'] = false;
}
return $options;
}
Hi there,
try changing this line:
if ( ! is_category( 'success stories' )() ) {
to:
if ( is_category( 'success-stories' ) ) {
Whoops...
So I was using a snippet plugin to add the code and when I activated it I got a fatal error. I've removed the plugin and decided to go a different route and just style the featured column on that archive with css.
I'm trying .featured-column as the selector to get control of the first featured post and style it but it does not seem to be working. Can I ask what the right selector is to style the featured-column? The goal is to make it full width with the image on the left and text on the right...
Thank you for you help David
remove what snippet you have and use this:
add_filter( 'option_generate_blog_settings', 'lh_disable_featured_column' );
function lh_disable_featured_column( $options ) {
if ( is_category( 'success-stories' ) ) {
$options['featured_column'] = false;
}
return $options;
}
Thank you David but I think I just want to style it with css if it's possible.
I didn't think of the idea first but it makes more sense with my sites design as I am going to style it to match some other elements on the site.
Can I ask how I would target the featured-column with css? I'd like to make it 100%, with the image on the left and text on the right.
I've tried .featured-column but that doesn't seem to be it...
Thank you
scratch that.
I've just realized using Elements makes more sense for what I am trying to do now. Sorry, I didn't think this one through before asking for help :( and thank you for your time.
Ok - glad to hear you have a plan :)