Archives: Tutorials

Sticky Table Header using jQuery

Complete Tutorial – Coming Soon <style>     td{         vertical-align: middle!important;     }     .table-fixed-header.fixed-header thead {         position: fixed;         top: 0px;         background: white;         z-index: 9999;     }     </style> <script>     jQuery(document).ready(function(){                  var tableFixedHeader = $(‘.table-fixed-header’);                  var tableFixedHeaderHead = tableFixedHeader.find(‘thead’);         var tableFixedHeaderBody = tableFixedHeader.find(‘tbody’);                  tableFixedHeaderHead.css(‘width’, tableFixedHeaderHead.outerWidth());         tableFixedHeaderBody.css(‘width’, tableFixedHeaderBody.outerWidth());                  tableFixedHeaderHead.find(‘th’).each(function(){             $(this).css(‘width’, $(this).outerWidth() );         });                  tableFixedHeaderBody.find(‘td’).each(function(){             $(this).css(‘width’, $(this).outerWidth() ); […]

Read more

Fix font CORS policy issue using Apache

Please add the following code in your .htaccess file Header set Access-Control-Allow-Origin “*”

Read more

How to use WordPress Rewrite API?

Complete tutorial – Coming Soon function custom_rewrite_basic() { add_rewrite_rule(‘^products/([^/]*)/reviews/([^/]*)’, ‘index.php?product-slug=$matches[1]&product-child=reviews&product-comment-key=$matches[2]’, ‘top’); } add_action(‘init’, ‘custom_rewrite_basic’); function prefix_register_query_var( $vars ) { $vars[] = ‘product-slug’; $vars[] = ‘product-child’; $vars[] = ‘product-comment-key’; return $vars; } add_filter( ‘query_vars’, ‘prefix_register_query_var’ ); function prefix_url_rewrite_templates() { if ( get_query_var( ‘product-slug’ ) && get_query_var( ‘product-child’ ) == ‘reviews’ && get_query_var( ‘product-comment-key’ )) { $product_slug […]

Read more

Add custom robots.txt on CDN SUN

Create robots-cdn in CDN Sun (https://cdnsun.com/) 1. Create robots-cdn.txt file on the root directory Add the following code User-agent: * Allow: /wp-content/* Disallow: / 2. On your site .htaccess add the following RewriteEngine On SetEnvIf X-Resource “#########” IS_CDNSUN_REQUEST=”yes” RewriteCond %{ENV:IS_CDNSUN_REQUEST} “yes” RewriteRule “robots.txt” “robots-cdn.txt” [L] ### = resource can be found at CDN Sun dashboard […]

Read more

WordPress: How to add author and publisher meta tag?

Add the following to your header.php or you can use wp_head() action to these codes. $post_author_id = get_post_field( ‘post_author’, get_the_ID() );

Read more