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-sharing-thumbnail-pvfw.php
Created June 6, 2020 01:14
put the code in your active theme's functions.php and put thw new image url in line 2 inside the quotes.
function tnc_change_share_image(){
return 'IMAGE_URL_HERE'; // change to the new image url
}
add_filter('tnc_pvfw_facebook_share_thumb_url', 'tnc_change_share_image');
@abdulawal39
abdulawal39 / hide-attachments-outline-pvfw.css
Created June 13, 2020 14:35
Css code To hide attachment and outline buttons on PDF Viewer for WordPress.
button#viewOutline {
display: none;
}
button#viewAttachments {
display: none;
}
@abdulawal39
abdulawal39 / pagenav-display.css
Created July 15, 2020 06:33
Fix previous and next buttons hiding issue on PDF Viewer for WordPress
/**
* This css is used to fix left and right nav buttons hiding issue on android devices
* for PDF Viewer for WordPress
* This css should be used in custom css section of PDF Viewer settings page. Screenshot: https://prnt.sc/ti13oh
*/
.pvfw_page_prev{
z-index: 100;
}
.pvfw_page_next{
z-index: 100;
@abdulawal39
abdulawal39 / hide-topbar-pvfw.css
Created July 18, 2020 10:51
Hide Topbar Completely in PDF Viewer for WordPress
/**
*
* This will hide the topbar on viewer page
* put the following css in custom css field of PDF Viewer options page
*
*/
.toolbar{
display: none;
}
@abdulawal39
abdulawal39 / hide-shadow-pvfw.css
Created July 19, 2020 07:36
Hide Page Shadow in viewer PDF Viewer for WordPress
/**
* Css code to hide shadow from pages
* in PDF Viewer for WordPress
* Put this css in Custom CSS field of PDF Viewer options page
*/
.textLayer{
box-shadow: none;
-webkit-box-shadow: none;
}
@abdulawal39
abdulawal39 / pvfw-links-new-tab.php
Created September 24, 2020 15:44
force all links in pdf to open in a new tab - PDF Viewer for WordPress
@abdulawal39
abdulawal39 / S3-CORS.json
Created December 14, 2020 12:37
s3 cors
[
{
"AllowedHeaders": [],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@abdulawal39
abdulawal39 / hide-pdf-viewer-from-wordpress-search.php
Created March 21, 2022 16:00
Exclude PDF Viewers from WordPress Search Results.
/**
* Please add this code in your active theme's functions.php file
* This will exclude PDF Viewer from WordPress Search Results
*/
add_action( 'init', 'tnc_hide_pvfw_search', 99 );
function tnc_hide_pvfw_search() {
global $wp_post_types;
@abdulawal39
abdulawal39 / change-pdfviewer-slug.php
Created January 26, 2023 18:01
Change the slug of pdf viewer for wordpress from pdfviewer to anything you prefer. Put the code below in your active theme's fuctions.php file
if( ! function_exists( 'themencode_change_pdfviewer_slug' ) ):
add_filter( 'register_post_type_args', 'themencode_change_pdfviewer_slug', 10, 2 );
function themencode_change_pdfviewer_slug( $args, $post_type ) {
if ( 'pdfviewer' === $post_type ) {
$args['rewrite']['slug'] = 'pdfs'; // replace pdfs with your preferred slug
}