Skip to content

Instantly share code, notes, and snippets.

View abdulawal39's full-sized avatar
🎯
Focusing

Abdul Awal Uzzal abdulawal39

🎯
Focusing
View GitHub Profile
@abdulawal39
abdulawal39 / change-fullscreen-link-target.php
Created October 24, 2024 12:23
Change fullscreen mode link target for TNC FlipBook - PDF viewer for WordPress
@abdulawal39
abdulawal39 / tnc-flipbook-disable-archive-hide-from-google.php
Created September 26, 2024 09:04
Use this code in your active theme's functions.php file.
function tncpvfw_support_disable_pdfviewer_archive_and_hide_from_google($args, $post_type) {
if ($post_type === 'pdfviewer') {
$args['has_archive'] = false;
}
return $args;
}
add_filter('register_post_type_args', 'tncpvfw_support_disable_pdfviewer_archive_and_hide_from_google', 10, 2);
function tncpvfw_support_add_noindex_meta_tag() {
echo '<meta name="robots" content="noindex, nofollow" />';
@abdulawal39
abdulawal39 / drag-flip-tnc-flipbook.php
Created July 29, 2024 07:24
This snippet allows users to click and drag to flip for TNC FlipBook: https://codecanyon.net/item/pdf-viewer-for-wordpress/8182815
/**
* This function allows users to click and drag anywhere to flip
* Specifically for TNC FlipBook: https://codecanyon.net/item/pdf-viewer-for-wordpress/8182815
* Put this code in your active theme's functions.php file
*
* @return void
*/
function tnc_pvfw_support_allow_drag_flip_anywhere() {
?>
@abdulawal39
abdulawal39 / autolink-without-domain-restriction.php
Created July 25, 2024 13:23
Allow autolink without domain Restriction for TNC FlipBook
@abdulawal39
abdulawal39 / tnc-flipbook-icons-custom-css.css
Created July 9, 2024 17:26
Change the position and roration of previous and next icons for TNC FlipBook
.pvfw_page_prev img, .pvfw_page_next img{
transform: rotate(90deg);
}
.pvfw_page_next {
z-index: 100;
bottom: 0;
top: inherit;
left: 45%;
right: inherit;
@abdulawal39
abdulawal39 / gist:1ae8c2534b02c9d6a384445cdc370c45
Created March 1, 2024 09:55
Compress a folder (Create Zip File) excluding dot files from mac or linux terminal.
zip -r FILE_NAME.zip FOLDER-NAME -x "*/.*"
@abdulawal39
abdulawal39 / helper-functions.php
Created February 26, 2024 19:27
Fix for html files not working with file type setting of wp file access manager.
/**
* It has to be overwriten in the plugin file manually unfortunately.
* For some reason, the standard wp function for checking mimetype does not return proper value for the html or htm files.
* Thats why the following function needs to be edited to fix the issue.
* The file is inside includes folder named helper-functions.php
* Simply find the function named get_file_mime_type and replace the whole function with the following.
*/
function get_file_mime_type( $file_path ){
$mime = mime_content_type($file_path);
@abdulawal39
abdulawal39 / hide-scrollbar-pvfw.css
Created December 5, 2023 10:20
Add the css code in TNC FlipBook > Global Settings > Custom CSS field to hide the scrollbar. This snippet is for TNC FlipBook - PDF viewer for WordPress: https://codecanyon.net/item/pdf-viewer-for-wordpress/8182815
/* Hide scrollbar for Chrome, Safari and Opera */
#viewerContainer::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
#viewerContainer {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
@abdulawal39
abdulawal39 / disable-text-selection.php
Created November 13, 2023 11:19
Disable Text Selection on TNC FlipBook - PDF viewer for WordPress Plugin
/**
* Add the following code in your active theme's functions.php file
*/
function tnc_pvfw_disable_text_selection_script() {
?>
<script>
document.addEventListener('DOMContentLoaded', function () {
document.body.style.userSelect = 'none';
});
@abdulawal39
abdulawal39 / disable-pdfviewer-archive.php
Created September 13, 2023 10:20
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;