Skip to content

Instantly share code, notes, and snippets.

View pradeep910's full-sized avatar
🏠
Working from home

Pradeep Sonawane pradeep910

🏠
Working from home
View GitHub Profile
@pradeep910
pradeep910 / force-download.php
Created March 14, 2018 09:19
Download PDF file
<?php
$file = "filename.ext";
// Quick check to verify that the file exists
if( !file_exists($file) ) die("File not found");
// Force the download
header("Content-Disposition: attachment; filename="" . basename($file) . """);
header("Content-Length: " . filesize($file));
header("Content-Type: application/octet-stream;");
readfile($file);
?>
@pradeep910
pradeep910 / rt-amp-gravity-form-fix.php
Last active July 8, 2020 11:47
Fix for gravity form submission with page update in AMP native mode (amp-wp plugin)
<?php
/**
* Plugin Name: Gravity form fix for AMP-WP plugin
* Description: Fix for gravity form submission with page update in AMP native mode (amp-wp plugin). Gravity forms submission with page update fix for AMP Native mode of amp-wp plugin. https://ampbyexample.com/components/amp-form/#form-submission-with-page-update
* Plugin URI: https://gist.github.com/pradeep910/b25525034289ab0bc2b7fa0896f4ac90/
* Version: 0.1
* Author: Pradeep Sonawane
* Author URI: https://pradeepsonawane.com
*
* @package rtCamp
@pradeep910
pradeep910 / rt-gutenberg-block-grid-support.scss
Last active September 12, 2018 16:10
Gutenberg Columns Block and Gallery Block CSS Fix (.scss version)
/* Gutenberg Columns Block (Beta) Responsive CSS Fix */
.wp-block-columns {
display: grid;
grid-gap: 1rem;
grid-auto-flow: dense;
.layout-column-1 {
grid-column: 1;
}
.layout-column-2 {
@pradeep910
pradeep910 / rt-amp-mailchimp-for-wordpress-fix.php
Created February 3, 2019 17:13
AMP support for MailChimp for WordPress plugin
<?php
/**
* Plugin Name: MailChimp for WordPress - AMP Support
* Description: Fix for MailChimp form submission with page update in AMP.
* Plugin URI: https://pradeepsonawane.com
* Version: 0.1
* Author: Pradeep Sonawane
* Author URI: https://pradeepsonawane.com
*
* @package rtCamp
@pradeep910
pradeep910 / rt-amp-enabler-for-non-amp.php
Last active April 2, 2019 12:49
Include amp-runtime script for Non-AMP pages.
<?php
/**
* Plugin Name: AMP Framework enabler for Non AMP.
* Description: Enables AMP as Framework enabler for Non AMP.
* Plugin URI: https://rtcamp.com
* Version: 0.2
* Author: rtCamp, pradeep910
* Author URI: https://rtcamp.com
*
* @package rtCamp
@pradeep910
pradeep910 / Sample responsive amp-video-iframe
Last active August 8, 2019 08:20
Responsive amp-video-iframe based on sizes with media query.
<!-- Page 6 (Rabbit): 3 layers (fill (video) + vertical + vertical) -->
<amp-story-page id="page6">
<amp-story-grid-layer template="fill">
<!-- DESKTOP -->
<amp-video-iframe media="(min-width: 900px)"
id="myVideo"
src="https://sudhir.dev/videojs-example/amp-videojs-embed1.html"
@pradeep910
pradeep910 / amp-error-handling-example.php
Created September 23, 2020 10:23
AMP error handling example for WordPress
<?php
function amp_wp_org_is_amp() {
return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint();
}
if ( amp_wp_org_is_amp() ) {
// Remove script from AMP pages.
wp_dequeue_script( 'script-handle' );
}
path group type
/rv-dealership-websites sips s
/blog/2023/12/07/identify-prioritize-your-digital-marketing-channels-in-the-modern-market sub-pillar s
/mobile-websites sips s
/why-interactrv sips s
/google-vehicle-listings sips s