Skip to content

Instantly share code, notes, and snippets.

@ejcabquina
Created March 12, 2021 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ejcabquina/60f052a3667da05d479749cb3be3daad to your computer and use it in GitHub Desktop.
Save ejcabquina/60f052a3667da05d479749cb3be3daad to your computer and use it in GitHub Desktop.
if(is_archive() || is_home() ){
add_filter( 'generate_has_default_loop', '__return_false' );
}
add_action( 'generate_before_main_content', function(){
if(is_home()){
if ( function_exists( 'wpsp_display' ) ) wpsp_display( 1794 );
}
if( is_archive() ){
$cat = get_category( get_query_var( 'cat' ) );
$cat_slug = $cat->slug;
if ( function_exists( 'wpsp_display' ) )
wpsp_display( 8033, 'tax_term="' . $cat_slug . '"'
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment