Category Archives: WordPress Blogs

11Jul/13

Require Login For Single WordPress Page

By default, anyone who comes to your WordPress website can see any page on that website.  What if you want your website to be open to everyone, except you really need to have a page or two that only registered, logged in users see?  Example?  A company intranet, a calendar that’s only for family or a contact info page that’s only for family.  Whatever the reason, there are only a few ways to make sure a page isn’t open to the world.

Make the page private

You know what I mean.  When you’re editing your page you look over on the right side just above the Publish/Save button an see a “Visibility” option.  You can make that private and the page is hidden from the public, but it’s also hidden from all other registered users.  When set to private a page also doesn’t show up in the main menus or anywhere else.  It’s basically hidden from everyone from the one who made it private.

Password protect the page

Under that same “Visibility” section you can also choose “Password protected”.  This is good.  The page shows up in the menus and all that, but this option asks for a password for this particular page.  Basically, you set a password for this page and then you have to share that password with anyone you want have access to the page.  That’s not quite what I’m after.

Create a new page template

So, to recap, I wanted a page that shows up in the menus just like any other page but whose content can only be seen by users who have an account on the website and have logged in.  For all others, I want the page content hidden.  Here’s what I came up with because I couldn’t find a plugin that accomplished this without annoying upgrade messages or adding a lot of bloat for no reason.

  1. Create a new page template by making a copy of your theme’s existing page.php template.  I named mine “page_logged_in.php”.
  2. Once you have your page you need to edit the file in whatever editor you like.  I use Dreamweaver, but any text editor will work just as well.  The first bit of code you need to add names the template so you can find it later.  (This is what you’ll select in the WordPress admin when creating your new page.)  Just add the following code to the very top of the code.  There will most likely be something similar already there.  If so, just replace it.
  3. Now you need to add a little code to see if the user is logged in.  This is pretty easy.  WordPress has hooks built in for this.  The following can be added directly below the Template Name code above, also at the top of the page before any of the standard WordPress stuff.

     

  4. Now, go to the very bottom of the page and add the following code.  This will call wp_die() to halt WordPress and display a notice to the visitor saying they need to log in to view the page.

     This little snippet does a couple things.  If it runs (if the user isn’t logged in) then it halts the page and displays a message that says “To view this page you must first log in.”  The words “log in” are a link created by wp_login_url() which is another WordPress hook.  You may notice get_permalink() embedded in wp_login_url().  What this does is gets the address of the page you’re on so that when the user clicks the link to log in, they come back to your password protected page once they log in.  You can forward them pretty much anywhere you want, but I like to bring people back to where they started to minimize confusion.

  5.  

    Now just save the page template and upload it to your web server where your template files are.  Hopefully you simply duplicated page.php where it already lived, so this is a no brainer.

  6. Next, go to WordPress and create a new page.  Under “Page template”, select the new page template we just created.

  7. Save your new page and that’s all there is to it. That page will now appear just like any other page in your menus, but when a user who is not logged in tries to visit it, they will receive the notice you included above.

Hope this helps.  I looked for a way to do this for about a half a day.  This seems to be a simply way to go about it.

 

13Oct/12

Herbert Lumber – Riddle Oregon

Herbert Lumber had recently lost their website to a server crash.  Scary.  Especially since their host didn’t have a backup.  When I talked to them they were trying to figure out how to get a website back up that they could back up and maintain themselves.  Hmmmm.  What do I have that would work for that?  Yep.  WordPress.

Herbert Lumber Company

It came out pretty well.  They had some of the original photos that they had used on the original site and even some of the content from the pages.  I was able to get a custom WordPress theme set up for them in a couple days and moved all their photos and content over in a few hours.  Now they have a site they can maintain, update and, most importantly, back up on their own.

Unfortunately, Herbert Lumber wasn’t the first client I had talked to that week who had lost their website to a server crash with no backups.  I decided it wouldn’t be a bad idea to have a way to back up a full WordPress installation with a single click from the Dashboard in WordPress.  I wrote a plugin that is available from WordPress that makes a backup of your entire database as well as your entire web root folder.  That means that if you have information on your website that’s not in WordPress, my plugin backs that up too.  Pretty cool, really.  One click makes the backup file, then shows you a link to it so you can download it to your local computer.  Then you just delete the backup file from the server and you’re good to go.  You can run the backup as often as you like.

If you have lost your website, or you’re not happy with the one you have, give me a call.  I’m sure I can help you put something together that will fit your needs, look great and be under budget.

11Oct/12

Coast Professional Services – Roseburg OR

Coast Professional Services is a local insurance agency.  Like Fotan, he’s basically a one man show and specializes in giving personal service.  He knows his clients by name and answers the phone when you call.  There’s really only one email address because he’s the one who checks it.  Ron originally paid several thousand dollars to a guy who said he “specializes in insurance agent websites”.  That sounded great.  Except he got a site that looks exactly like all the other insurance websites he did and it didn’t capture the feel of Ron’s agency.  Oh, plus he was paying hundreds of dollars a month to Google AdWords and not getting a single lead from his shiny new website.

When I came in I was able to give Ron a custom WordPress website with a very comfortable home town look.

Coast Professional Services

Ron is able to update his website on his own, which is great because he has a lot to say about Obamacare and the insurance industry in general.  He posts blog entries every now and then, which then submits his website to Google, Bing and several other search engines and directories.  Now he comes up in Google searches.  Pretty cool trick, huh?

Ron has become my insurance guy.  I highly recommend him.  I really prefer to keep my money local, but it really comes down to the value you get for your money.  If it looks like I can give you what you want better than the guy down the street from you, but I’m not local, you’re still better off hiring me.  At least you know who you’ll be talking to if you have changes.

09Oct/12

UCC Accreditation WordPress Blog

I’ve been on contract working as webmaster for Umpqua Community College for quite a while now and one of the things they asked me to do was to take their Accreditation blog and clean it up.  Before I got to it it was a stock WordPress theme and didn’t look anything like UCC’s website.  The only way to tell it was UCC’s was that it said so in the header.  No logo, no nothing.

I found a theme that would let us upload a full page photo to display behind the content.  I was able to adjust the colors of the theme to match UCC’s standards and reorganized the whole site so it flows and makes sense now.

I think it came out great.  Could probably use a better photo for the background, but anyone who has ever been there will recognize the fountain on the right side.

The best part is that UCC is thrilled with it.  Very professional and lets the world see them that way.

If you have a website that’s not putting your best foot forward, let me know.  I can help you too.

13Apr/12

Puget Sound Platter

PSP is a site all about the food scene in the Puget Sound area.  Karen, the owner, is quite the foodie and wanted to be able to share all the great local food related happenings as well as write-ups about local restaurants, pubs, cooking schools…  Pretty much everything food related, but with a local focus.

The site is pretty straight forward except that she needed a way to compile her own lists of establishments and wanted to be able to sort them her own way.  What I ended up doing was coding an add-on for WordPress that gave her access to her own database so she could do what she wanted to do.  Pretty slick.  It finds latitude and longitude of an address as she’s inputting it so it can show up on the map in just the right spot.  It also allows her to place paid ads throughout the site in specific ways so it doesn’t lose its local feel.  Oftentimes ads stick out like a sore thumb, but I think she’s done a great job keeping the design clean and easy to follow.

So, if you’re planning a trip to the Seattle area, check out the Puget Sound Platter.  There’s a lot of good food up there.  You just need to know where to find it.

11Apr/12

Roseburg Country Club

So, the Country Club had a great website.  Designed by my friends over at BBG Marketing many moons ago.  As often happens these days, RCC wants to be able to update their website without having to “call the web guy”.  They also wanted to make the site more interactive.  Randy, the pro, wants to post tournament rosters as well as results so members can check the website rather than calling the pro shop to find out how the tournament is going, or who put the most balls in the pond on 18 trying to reenact the final scene from Tin Cup.  Anyway, a redesign and WordPress conversion was the only way to go.

 

I gave them a couple cool features.  The most obvious in the picture above is that the whole website’s background is made up of a photo of the course.  Not just one photo though.  There are actually a number of photos that are grabbed randomly each time a user hits the site.  In other words, go to the site right now and maybe you’ll see a picture of #4 from the tees.  Go back tomorrow and you might see the clubhouse from 18’s green.  “Why not make a new picture come up every time I visit a page” you say?  Well, that would just be silly.  Those pictures are kind of big, so I only want you to have to download one each time you visit the site.  Otherwise page load times could be pretty long if you’re on a slow internet connection.  I know.  “Nice job Matt.  You really think of everything, don’t you?”  Yeah.  I try.  That’s what makes me worth what I bill. 🙂

Another thing you might notice is that the majority of the site is semi-transparent so you can see the background. Why would you want to cover up those awesome backgrounds and not even be able to see them?

They are also able to post PDFs of menus, tournament pairings and results to the website that end up embedded in the website rather than opening in a big, ugly window in your browser or downloading so you have to try to find it in the sea of icons all over your desktop.  There is also a calendar of events, a tour of each hole and a blog so they can keep everyone up to date on what’s happening in the restaurant, frost closures in the winter or whatever happens at a country club that they want people to know about.

Fun site.  Great course.  Nifty pool for the kids.

08Mar/12

Integrity Team Real Estate Services

Integrity finally got tired of paying hundreds of dollars a month for a cookie cutter website that looked just like everyone else’s.  When I met with Janet she was looking for something to make her stand apart from the competition.  As a successful real estate broker she had been meticulous in the design of her business cards, her signs, her new office in downtown Roseburg.  She wanted clean lines, classy, something that would really catch the eye.  I think I did a pretty good job.

What you’re seeing above is the listing details page for one of Janet’s listings.  I’ll tell you about a few of the cooler features of the site.

  • At the top, you’ll see “About the Company”, “Local Events”, and “Local Info / Links”.  All three of those pages are self managed by Integrity.  They have an administrative back end (custom built by me) that they log into to add or edit content for those pages.
  • The photo at the top right of the stream is actually a photo slideshow.  They can place any number of photos in the slideshow and each time a page loads the slideshow grabs a number of them and starts displaying them with a nice fade in/fade out transition.  I limited the number of slides so that the page didn’t take forever to load.  More pictures = more time to download.  As it is, the page loads quickly, but you get a seemingly random slideshow each time.  Pretty cool.
  • The menus are actually what is known as a Mega-Menu.  Most of the links are pretty normal, but if you roll over “Meet The Team” you see a dynamically generated grid of brokers.  The list is created from the database which, you guessed it, Integrity has full control over.  They add/edit/remove brokers on the fly.  Each broker profile has space for a photo, contact information, social networking links and all the normal stuff.  The broker profile page also shows each broker’s listings and, at some point, will also show blog posts for that particular broker.
  • The blog.  Ok.  Janet knows that the real value to a real estate broker is the knowledge in their head.  She wanted to be able to share that knowledge as well as boost her Google ranking, so we integrated a custom WordPress blog with the same design as her website.  The benefit to having it all together is that I can grab posts from a given category, tag or author and display them anywhere I like on the website.  Hence the statement above about showing blog posts on broker profile pages.  It’ll be super cool once the brokers really start posting.
  • The slideshow of photos is pretty cool.  Nothing overly special that you don’t see every day, but the thumbnails are squared off and outlined and move along with the main photo.  Oh, and the buttons are styled to match the rest of the site.  Nice, but not rocket science.
  • The listing data is obviously pulled automatically from the RMLS using my IDX feed.  No rocket science there either.  If you have a real estate website and you’re not utilizing some form of IDX you should really pull your head out of the sand and join the 20th century.
  • The map.  This is totally cool.  On the left you see a list of 10 listings of similar price and size (beds/baths/sqft) within a predefined radius. As you hover over the entries on the left, the photo and listing info on the right change as does the map.

So, lots of cool features.  All custom coded and pieced together to fit Janet’s vision of what she wanted a website to be.  I can do the same thing for you.  Just give me a call and we can talk.

08Mar/12

EmbertsonCPA.com

Rick needed a site refresh in a bad way.  He also wanted to be able to update his website in house and needed to be found on Google.  His old site was somewhere around page 14 on Google and used bright, vibrant colors and, well, didn’t work.  Logins that lead to nowhere.  Pages dedicated to a single line of text.  Just odd and didn’t really fit his style.  I met with him and a couple of his office people and we decided the best option for him was a WordPress website with a custom design.

Going off his business card and a tri-fold pamphlet I was able to customize a WordPress theme to fit his needs and style.  Subtle blues and grays, his logo, a classy font…  He also has the ability to add pages, post tips for his clients and edit everything down to the size and color of text.

Oh, and 3 weeks after launching he showed up on the first page in Google.  Pretty impressive considering all we did was move his old content over to a fresh design.  Google obviously LOVES WordPress.  I think I do too.  What can I say?  I’m a fan. 🙂

09Oct/11

Leif Photography

Gary had been trying to find someone local who could take a design he had purchased online and make it work for his purposes.  As it turned out, the design he purchased had a bunch of Flash that made it very difficult to modify.  I basically re-created the look of the design he bought, but dumped the Flash and added some PHP fed JavaScript slideshows (12 of them on the home page) and gave him a way to upload photographs that a script on the server resized, created thumbnails and moved to a folder for each of the 12 slideshows.  What he ended up with was the ability to change the photos that come up in the slideshows himself.  No need to call the web guy.

Once he got the “do crazy stuff with my website” bug, he had me add a custom blog that he uses to showcase shoots and let people download low resolution versions of their photos for use on sites like Facebook, add a music player that let him choose specific music based on the page, add a full blown photo gallery that lets him upload as many photos as he likes (I think there are a couple thousand as of today) and a way to upload tips and coupons to go with specific photo galleries.  Very fun site.  Gary really knows how to test my creativity in coding.

 

09Oct/11

Sadler Aircraft Blog

Sadler’s website needed a way to be kept updated, but the original design was 100% Flash.  No good for quick, easy updates.  (I hate Flash, if I haven’t mentioned that…)  A custom blog seemed like just the thing.  This was before WordPress was as easy as it is now.  Creating a theme that matched their website required days of staring at thousands of lines of code.  In the end, we matched it almost exactly.

The end result included a blog they updated a couple times a week, a newsletter plugin that let them send out HTML newsletters to their fan base of a thousand, or so, people and links back to pages on the original Flash-based site.