Web Designer Tools

RSS

Posts tagged with "code"

Valdelama - MOSTO: A lightweight framework for forms

Apr 5

Post Reading Duration WordPress Shortcode - WPExplorer

Create A Embed Github Gists Shortcode

Nov 4

Nibbler - test your website

Responsive Web Design Patterns | This Is Responsive

Quick and easy Wordpress redirection to external URL

Redirect non logged-in visitors to a Wordpress site to another external URL.

I recently built a website for a client who had an existing site on another domain. While the new website was being setup, they wanted any visitors to go straight to the existing site instead of seeing a coming soon page.

There are plenty of Under Construction, Maintenance and Coming Soon plugins for Wordpress. These all display a page that says Under Construction, Coming Soon or similar, but not many will automatically redirect a visitor to another domain.

This quick solution can be implemented in a couple of minutes, and will allow access to the whole website to all users who are logged in, and send everyone else to the alternative domain.

The setup

Create a blank html file named redirect.html (or whatever you prefer) in the root directory of your domain

Add this code to your functions.php:

if(!is_user_logged_in() && $pagenow != ‘wp-login.php’) {wp_redirect( ‘/redirect.html’, 302 );}

From the control panel for your web server, set up a redirect for the file yourdomain.com/redirect.html to the external URL you want to send non logged-in visitors to.

To turn off, remove the function from your functions.php file and the redirect from your web server

HTML5: How to Use <DETAILS> and <SUMMARY> Tags

Free CSS3 Button Styles - Vol 2 | MediaLoot

Easily Customize WordPress Default Functionality

CSS-Only Responsive Layout with Smooth Transitions

tablecloth.js - a jQuery plugin that helps you easily style HTML tables

Animate.css - a bunch of plug-and-play CSS animations

The future of HTML5 video | Feature | .net magazine

Adding Phone Numbers To Web Pages With HTML5 & Microdata

Web Designer Tools is part
of the AW web network