<a class="facebook-share" onClick="window.open('http://www.facebook.com/sharer.php?u=<?php echo site_url();?>','Facebook','width=600,height=300,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-150)+''); return false;" href="http://www.facebook.com/sharer.php?u=<?php echo site_url();?>"><i class="fa fa-facebook"></i></a> <a class="twitter-share" onClick="window.open('http://twitter.com/share?url=<?php echo site_url();?>&text=<?php bloginfo('title'); ?>','Twitter share','width=600,height=300,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-150)+''); return false;" href="http://twitter.com/share?url=<?php echo site_url();?>&text=<?php echo str_replace(" ", "%20", bloginfo('title')); ?>"><i class="fa fa-twitter"></i></a> <a class="google-plus-share" onClick="window.open('https://plus.google.com/share?url=<?php echo site_url();?>','Google plus','width=585,height=666,left='+(screen.availWidth/2-292)+',top='+(screen.availHeight/2-333)+''); return false;" href="https://plus.google.com/share?url=<?php echo site_url();?>"><i class="fa fa-google-plus"></i></a> <a class="pinterest-share" href='javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());'><i class="fa fa-pinterest"></i></a>
Responsive youtube video embed – Bootstrap
<div class="embed-responsive embed-responsive-16by9"> <iframe class="embed-responsive-item" width="816" height="459" src="https://www.youtube.com/embed/ctvlUvN6wSE" frameborder="0" allowfullscreen></iframe> </div>
Create Custom WordPress User Roles
// To add the new role, using 'international' as the short name and // 'International Blogger' as the displayed name in the User list and edit page: add_role('international', 'International Blogger', array( 'read' => true, // True allows that capability, False specifically removes it. 'edit_posts' => true, 'delete_posts' => true, 'edit_published_posts' => true, 'publish_posts' => true, 'edit_files' => true, 'import' => true, 'upload_files' => true //last in array needs no comma! )); // To remove one outright or remove one of the defaults: /* remove_role('international'); */
WordPress limit Comment Length
add_filter( 'preprocess_comment', 'jeba_wp_comment_length' ); function jeba_wp_comment_length($comment) { if ( strlen( $comment['comment_content'] ) > 4000 ) { wp_die('Comment is too long. Please keep your comment under 4000 characters.'); } if ( strlen( $comment['comment_content'] ) < 90 ) { wp_die('Comment is too short. Please use at least 90 characters.'); } return $comment; }
Note: Here can change comment length 4000 and 90 characters.
Change “Product Description” text in single product woocommerce
/** * Change on single product panel "Product Description" * since it already says "features" on tab. */ function wpcheatsheet_product_description_heading() { return __('YOUR CUSTOM TITLE', 'woocommerce'); } add_filter('woocommerce_product_description_heading', 'wpcheatsheet_product_description_heading');