Skip to content

Instantly share code, notes, and snippets.

View mahfuj156's full-sized avatar

Md. Mahafujur Rahman mahfuj156

View GitHub Profile
@mahfuj156
mahfuj156 / index.html
Created October 5, 2021 09:58
Move div to the cursor position on cursor move
<div class="circle"></div>
<p>Created with <i class="fa fa-heart"></i> by <a href="https://codepen.io/rakeshnayak/" target="_blank">Rakesh Nayak</a></p>
@mahfuj156
mahfuj156 / gist:c4b49feb8725fa0e3e6e7568c4c4ba89
Created September 1, 2020 08:56
How to create a dynamic Open Graph (OG) image for your website by WordPress
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-thumbnail' ); ?>
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="og:description" content="" />
<meta property="og:image" content="<?php echo $image[0]; ?>" />
<meta property="og:video" content="" />
<meta property="og:video:width" content="560" />
<meta property="og:video:height" content="340" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
@mahfuj156
mahfuj156 / gist:73c29511196c6317a4df1fc77062c3a7
Created September 1, 2020 07:09
Custom code for WP MAIL With Attachment
if(isset($_POST['photoupload_submit'])){
$rand = rand(0000,9999);
// Count total files
$countfiles = count($_FILES['file']['name']);
$subject = "Payment received #$orderidnumber";
$message ='<p>You have reviced payment following order Id: ' . $activation_link . '</p>';
@mahfuj156
mahfuj156 / WooCommerce - Single Product Page Show Related Product show in same category by WP Custom Query
Last active September 1, 2020 07:10
WooCommerce - Single Product Page Show Related Product show in same category by WP Custom Query