Skip to content

Instantly share code, notes, and snippets.

@thecodepoetry
Last active March 22, 2018 21:06
Show Gist options
  • Select an option

  • Save thecodepoetry/9ceced7f7dff0501c01c to your computer and use it in GitHub Desktop.

Select an option

Save thecodepoetry/9ceced7f7dff0501c01c to your computer and use it in GitHub Desktop.
Dynamic page layout management
add_action( 'get_header', 'dt_archive_layout', 10 );
function dt_archive_layout() {
$config = Presscore_Config::get_instance();
if( is_archive() || is_category() || is_search() ){
$config->set( 'template.columns.number', '5' );
$config->set( 'post.preview.width.min', '200' );
$config->set( 'image_layout', 'resize' );
$config->set( 'thumb_proportions', array( "width" => "2", "height" => "1" ) );
}
}
@TooLogic
Copy link

Hi,
Can I create separate archive layout for teammate posts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment