23 July 2020

How to show/display content after post content in wordpress?

show/display content after post content in wordpress. 


function yourprefix_add_to_content( $content ) {
if( is_single() ) {
$content .= 'Your new content here';
}
return $content;
}
add_filter( 'the_content', 'yourprefix_add_to_content' );

How to create wp_editor/Custom editor in wordpress/Woo-commerce?

Create wp_editor/Custom editor in wordpress/Woo-commerce.


add_action("admin_init", "certifications");
add_action('save_post', 'save_subdescription');
function certifications(){
add_meta_box("sub_description", "Certifications", "meta_function", "product");
}
function meta_function(){
global $post;
$custom = get_post_custom($post->ID);
$sub_description = $custom["sub_description"][0];
wp_editor( $sub_description, 'certifications', $settings =
array('textarea_name'=>'sub_description','dfw'=>true) );
}
function save_subdescription(){
global $post;
update_post_meta($post->ID, "sub_description", $_POST["sub_description"]);
}



function show_certification_content(){

echo get_post_meta( get_the_ID(), 'sub_description', true );



//echo get_the_content();
}
add_action('woocommerce_before_single_product_summary','show_certification_content');

17 July 2020

How to send email in wordpress?

Send email in wordpress.



$contactfirstname ="lali";

// No need to make changes below this line.
 $toadmin = "developwithjaspreet@gmail.com";

$adminmessage = 'You just got one visitor. Here is the detail below';
$noreply = 'noreply@jaspreet797386@gmail.com';
$headers = "From: " . $contactfirstname . "\r\n";
            $headers .= "Reply-To: ". strip_tags($noreply) . "\r\n";
            $headers .= "MIME-Version: 1.0\r\n";
            $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers = 'From: "' . $contactfirstname . '" <no-reply@randhirstudsios.com>' . "\r\n";
wp_mail( $toadmin, $contactfirstname, $adminmessage, $headers );

How to send email after saving post in wordpress?

Send email after saving post in wordpress



function action_publish_post( $ID, $post ) { 
$contactfirstname ="Jassi";

// No need to make changes below this line.
 $toadmin = "developwithjaspreet@gmail.com";

$adminmessage = 'You just got one visitor. Here is the detail below';
$noreply = 'noreply@jaspreet797386@gmail.com';
$headers = "From: " . $contactfirstname . "\r\n";
            $headers .= "Reply-To: ". strip_tags($noreply) . "\r\n";
            $headers .= "MIME-Version: 1.0\r\n";
            $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers = 'From: "' . $contactfirstname . '" <no-reply@randhirstudsios.com>' . "\r\n";
wp_mail( $toadmin, $contactfirstname, $adminmessage, $headers );
}         
// add the action 
add_action( 'publish_contracts', 'action_publish_post', 10, 2 ); 


16 July 2020

How to remove/disable drag image from website?

Remove/disable drag image from website


jQuery(document).ready(function($){


$('img').mousedown(function(e){

 return false;


});

});

How to add custom attribute in body in wordpress?

Add custom attribute in body in wordpress.


function wp_body_classes( $classes )
{


    $classes[] = '"oncontextmenu="return false;';

    return $classes;
}
add_filter( 'body_class','wp_body_classes', 999 );

How To Disable or Block Inspect Element in Browser/Website?

Disable or Block Inspect Element in Browser/Website



<body oncontextmenu="return false;">




</body>



document.onkeydown = function(e) {
  if(event.keyCode == 123) {
     return false;
  }
  if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
     return false;
  }
  if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) {
     return false;
  }
  if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
     return false;
  }
  if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
     return false;
  }
}

How to create video slider with cuncks of videos without download all videos?

 Create video slider with cuncks of videos without download all videos function custom_video_slider_shortcode() { $slider_id = 'vide...