Labs

Code snippets, hacks, plugins and tools to make your websites shine.

Including External JavaScript and CSS Stylesheets in a .NET Page

I’ve seen several ASP.NET developers architect their web apps so that the only way they can include page-specific CSS or JavaScript is via the code-behind file. That is a bad method because you generally want to keep as much display logic in the aspx as possible. It is actually very easy to structure your master

ASP.NET MVC Render Partial View to String

You may run into a situation where you would have to render a partial view to a string and then return it as part of a JSON response like this: The ability to do something like this would open up a ton of amazing possibilities, so I really scoured the internet looking for a solution.

Customize [Read More] or Continue Reading in Genesis Themes using code

By default Genesis Themes ship with [Read More] as hyperlink in blog archives. You can change it to one of your choice by using out this snippet. Steps: Login to Dashboard and go to Appearance -> Theme Editor. Make sure a Genesis child theme (see popular genesis themes) is active and you are not editing

Add Dynamic Month and Year to Post Content, Title and Meta using Shortcode

Add the current year by [year] and current month by [month] shortcodes anywhere, including content, title, meta title, excerpt and Rank Math Breadcrumbs. Description Add current year by [year] and current month by [month] shortcodes anywhere, including content and title. Use this plugin to boost your site’s SEO by using the variables anywhere. Supports RankMath

Remove Links & Other Spam from Comments in WordPress

Comments are no longer good for SEO but if you can’t still get rid of it, do it right. Some bloggers, link-building muddleheads may spam your comment area with multiple URLs. You can get rid of those by putting this code in your child theme’s functions.php file.

One click screenshot of any webpage

Get a one to two click screenshot of any webpage in .png. Download and use it on blogs and websites. Sometimes, it may fail to render a screenshot. Return back and retry if the screenshot is not generated. Add this to your site Here is the source code used to run this form: