Skip to content

Instantly share code, notes, and snippets.

@abdulawal39
Created September 13, 2023 10:20
Show Gist options
  • Save abdulawal39/d7aa809a8e042da88cb95bba4e46c1c5 to your computer and use it in GitHub Desktop.
Save abdulawal39/d7aa809a8e042da88cb95bba4e46c1c5 to your computer and use it in GitHub Desktop.
Disable archive page for pdfviewer post type on TNC FlipBook - PDF Viewer for WordPress Plugin
/**
* Add the following code in your active theme's functions.php file
*/
function tnc_pvfw_set_has_archive_false( $args, $post_type ) {
if ( 'pdfviewer' === $post_type ) {
$args['has_archive'] = false;
}
return $args;
}
add_filter( 'register_post_type_args', 'tnc_pvfw_set_has_archive_false', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment