How to limit the access of the content based on user’s registration date
A friend of mine has a paid and subscription based site. He wanted the site to limit access to content based on a user’s registration date. For example, if a user registered in August, he didn’t want him to be able to see the content from July and past content. This is one way to…
Adding code to allow an iframe in WordPress
I know there are security risks, a bad implementation, bad user experience, etc, but sometimes the client insists on it. Here is how allow iframes in posts and pages: add_filter( ‘wp_kses_allowed_html’, ‘ar_allowed_tags_filter’, 1, 1 ); function ar_allowed_tags_filter( $allowed_tags ) { if ( ! current_user_can( ‘publish_posts’ ) ) { return $allowedposttags; } $allowed_tags[‘iframe’] = array( ‘align’…
Quick and Dirty way to add code some Javascript to a footer
I every once and a while a client needs me to add some kind of Javascript code to the site. Most time it is a Google snippet or something for Facebook. It is always for tracking purposes. Just open functions.php and add this in the file. function ar_add_facebook_snippet() { ?>
How to get Apache to serve up .SVG and .SVGZ files
I ran into this today. This isn’t WP specific, but whatever. I’m sure I’ll have to do this again at some point. Basically, .SVG files are Scalable Vector Graphics. A .SVGZ is a compressed version of it. It is a really good type of file format on the web for things like logos and icons.…
Adding a Favicon correctly in WordPress
There are 19 different ways to “load” a favicon. You can put it in the of the site, just like how you would with a static site. I tend to a lot of people recommending of dropping your favicon into the root of your site, for example: https://aaronreimann.com/favicon.ico. But, what if people switch hosting and…
- « Previous
- 1
- 2
- 3