Ethos archive page - override layout setting for specific category

Hi there,
I’m using the standard setting for the archive pages (Ethos: Options > Blog > Archives = Standard)
But for specific categories (ex. Video) I want to use the “masonry” setting.
How can I change that?

Hi There,

Please add the following code under functions.php file locates in your child theme:

add_filter( 'x_option_x_archive_style', 'x_override_archive_style' );
function x_override_archive_style($style){
	if( is_category( array('video') ) ){
		return 'masonry';
	}
	return $style;
}

I could see that your X theme & Cornerstone plugin are outdated. Please update them to the latest version as well.

https://theme.co/changelog/

Thanks.

Thank you for your help, @thai . I updated as suggested.
The function works perfectly.

You’re welcome. Glad we could help. Just note though that filters in the theme like x_option are subject to change (see this article for details) in the future so this might break.

Thanks.

Thanks, I’ll take note. There is not much in the article about theme-specific filters.

As stated previously, filters are a little more involved than actions and there aren’t really many filters to utilize in X and Pro that are specific to the theme. If you ever need to modify a specific filter in WordPress, a quick Google search will usually yield plenty of information on how to modify it based on community input.

Hi There,

Those are the mainly used and available list. If you have a particular customization requirement, you may contact a developer to assist you.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.