WP plugin: Welcome Visitor!

posted on April 12, 2006

Hoho, another WordPress 2 plugin: Welcome Visitor! lets you add a welcome message on the sidebar or introductory note to the home page or whatever and wherever the heck you like. You edit the message from within the WordPress administration pages. The plugin sports a healthy selection of customizable options—for a simple message plugin, that is.

Installing Welcome Visitor! requires setting up a subdirectory for it (which needs to be: welcome-visitor) in your wp-content/plugins/ directory. This is because the plugin comes in two files, one being the administration page or what I call the welcome message editor. So either extract ‘welcome-visitor.php’ and ‘welcome-visitor-editor.php’ from the zip file after downloading it, set up the ‘welcome-visitor’ subdirectory on your host site, and upload the files to it, or unzip the welcome-visitor folder with the two files already in it and put that up in wp/contents/plugins/. However you do it, your directory tree for Welcome Visitor! should look just so:

  /wp-content
            /plugins
                   /welcome-visitor
                                  + welcome-visitor.php
                                  + welcome-visitor-editor.php

Once the plugin is installed and activated under Plugins, go to Options and you’ll find a Welcome subpanel tab. Click it to access the welcome message editor.

[Welcome Visitor! admin page]

That cropped thumbnail above links to a full image of the welcome message editor. If it looks a little familiar, that’s because it uses some bits from the basic (non-ahem-WYSIWYG) WordPress post editor. Making use of pre-existing code in WordPress helped keep the plugin light, but bear in mind your welcome message is not like a regular blog post, and some things won’t work as you may expect. For example, the ‘more’ quicktag (<!--more-->) is useless in the message content. Don’t say I didn’t warn you…

The following describe the (fully working) bits in the welcome message editor:

Title and Content fields
If these aren’t self-explanatory, well then GACK!
Message Status
Status of message on your blog: ‘Published,’ ‘Title only,’ ‘Content only’ or ‘Private.’ Setting to Title or Content only displays one or the other (guess which is which) and bypasses the HTML Style option (see next). Private is just what you’d think—the message is not displayed publically.
HTML Style
When message status is ‘Published’ you have the option to display the message in an unordered list (<ul><li> …), or within a <div> element. Setting to unordered list inserts message content in a nested or child list to the title. With either setting the title is placed in a <h2> header. Also, both the initial <ul> and the <div> element are given the css class welcome-visitor which you can use to style the message.
Display Options
On home page only: Display message only when on your home blog page. To registered users: Logged in users will see the message. Use content filtering: Run WordPress’ built-in text formatting filters on message title and content.
Update Message (button)
I hope this is another obvious bit.

Now that you have your message set up as you like, you need a way to display it on your blog. That’s where the welcome_visitor() function or template tag comes in:

Usage

<?php welcome_visitor('before', 'after'); ?>

Parameters

before
(string) HTML or other text which is displayed before the message. There is no default.
after
(string) HTML or other text which is displayed after the message. There is no default.

Examples:

<?php welcome_visitor(); ?>

This is the default usage and is recommended when displaying both title and content (’Published’) from your message.

<?php welcome_visitor('<div class="hello">', '</div>'); ?>

This places the message in a <div> with a custom css class of hello.

Author: Kaf Oseo
Categories: WordPress
Comments: (37) · Leave a comment · Comments RSS2 · Trackback URL

jazzle
Comment » April 12, 2006 @ 1:11 pm

Good idea.
I’d like to see an option to only show it to new visitors.
(Am thinking a simple cookie could do it)

Jimny
Comment » April 15, 2006 @ 12:30 pm

Yes, it would be great if you could make it so it only shows it once for each user.

SC
Comment » May 11, 2006 @ 5:48 pm

This is a nifty little plugin. Thanks. :)

DarkDan
Comment » May 23, 2006 @ 11:47 am

This is awesome! One question, is there any way to specify a different message for a logged-in user? So, for example, the new user gets a “please sign up” message and the logged in user gets a “Thanks for signing up, Dan!” message?

Thanks again!

internet marketing lessons
Comment » May 27, 2006 @ 7:27 am

Thanks Kaf for this great plugin,
i’m goint to install it right now
;)

Ken Savage
Comment » June 21, 2006 @ 3:09 pm

Very nice to have on my blog!

Mark McGrath
Comment » June 23, 2006 @ 2:48 pm

This plugin doesn’t seem to be working on my site. I have uploaded everything exactly how it describes in the instructions, but when I update the message, nothing appears on my site. I didn’t adjust the template tag at all, I’m strictly using <?php welcome_visitor(); ?> .
Looks like it would do a very nice job though. Unfortunate.

Mark McGrath
Comment » June 24, 2006 @ 7:01 pm

My mistake, it works correctly. However, it only works in IE. Nothing ever displays in Firefox. Very weird..

Laney
Comment » July 30, 2006 @ 1:06 am

I have a stupid question… after installing the plugin and activating it, what’s the next step? I thought installing, activating it were the only things to do…
thanks,
Laney

nolawi
Comment » August 6, 2006 @ 3:39 pm

you have to insert the code in the sidebar.. so it will call it out…

Anyways this only works in IE…. the plugin is a good tool, if you want to relay a message only to IE user… maybe to suggest that they view the site in another better browser..

Tim
Comment » August 14, 2006 @ 4:42 am

Mark and nolawi,
Try the plugin with Firefox 1.5.0.5, the plugin will display correctly. You may update your current version using the update wizard or manually check for updates using extension manager.

Karen
Comment » August 31, 2006 @ 9:54 am

Interestingly, I can’t get this plug in to work with I.E., but it works fine with FF.

landslide
Comment » September 8, 2006 @ 3:58 am

Ditto Karen’s comment, plugin works fine with FF, but I can’t get it to work at all with IE. Any suggestions?

praca
Comment » October 25, 2006 @ 3:02 am

Landslide! I got the same question the same problem! If anyone could help i will apreciate!

Mikhail
Comment » November 2, 2006 @ 12:19 am

Is it shown only for the first visit of an unique visitor?

Arzt
Comment » November 11, 2006 @ 9:25 am

Also in the IE7 it is nor working correctly…
Do you have a suggestion to fix it?

Renee
Comment » November 13, 2006 @ 9:27 pm

I’ve noticed this only shows up if the “www” is typed in the address. Is there a way to force it to work for either address?

http://tingull.com/trading - NOT there
http://www.trading.com/trading - IS there

AL
Comment » January 30, 2007 @ 3:37 pm

Hey thanks for the wonderful plugin, just what I was looking for!

Contrary to what everyone’s been saying, the plugin worked flawlessly in IE, FF, Opera.

What you have to do is make sure you set the message status to ‘published’ and insert the function call in the index.php page (at least that’s what I did and it worked)

For demo, check out: http://www.alhome.net

Thanks again!

Erik
Comment » February 7, 2007 @ 11:08 am

I can’t get it to work with Wordpress 2.1. I successfully installed it and put the function call into the index.php page, but I don’t get anything.

Any suggestions?

radiomestiza
Comment » February 9, 2007 @ 12:51 pm

hello, thank you for this, it´s exactly what i need, but i cant make it work…

i installed it and copy the code into page.php in my current theme, configures the message in options/Welcome Visitor! but nothing..

is there an specific place in the page.php code where i should put it_?

tank you in advance

radiomestiza
Comment » February 10, 2007 @ 3:27 am

sorrry for the bother; i IS working!, when logged in i couldn´t see the welcome message

thanks a lot

Henry
Comment » February 12, 2007 @ 7:15 am

I have activated the plugin but when I get to the OPTIONS > WELCOME tab, I got the following message: You do have permission to access this page. Anyone has the same problem? Would appreciate if any kind soul can solve my dilemma.

Henry

Les
Comment » February 15, 2007 @ 6:24 pm

I had the same problem as Henry. I got around it by editing the welcome-visitor-editor.php file. Around line 55 you will see this code:

global $user_level;
if ($user_level < 8)
die($no_access_msg);

There seems to be a problem with some 2.1 installs where the admin account doesn’t get the user_level set correctly, so you get an access denied message. Deleting those three lines worked for me.

Hochzeitsfilm
Comment » February 20, 2007 @ 8:08 am

It works good now, no problems….. Thanks!

Claudius
Comment » March 4, 2007 @ 7:13 pm

Hey man that’s a cool little plugin, I was just thinking of doing something like this a few minutes ago - but then I got it from you. Thanks man! :)

Giełda samochodowa
Comment » March 26, 2007 @ 4:44 pm

Is it shown only for the first visit of an unique visitor?

Darek
Comment » May 16, 2007 @ 2:59 pm

Thanks for great plugin, I love wordpress and this plugin I will use in my other blog (wordpress ofcourse) :-)

Wyniki na żywo
Comment » June 14, 2007 @ 6:05 am

Also in the IE7 it is nor working correctly…
Do you have a suggestion to fix it?….

Stancja
Comment » June 27, 2007 @ 6:41 am

I have seroius problem with CSS on IE with this plugin, I can fix it, please write some help

Leba
Comment » July 6, 2007 @ 6:44 am

As it was written above: Is it shown only to new visitors, if they weren’t on that site before?

Peter Lurie
Comment » October 12, 2007 @ 4:24 am

Hi!
Activated this plugin and tried opening Admin Menu item, and told me I did not have permission to view the Admin page.

I AM the Admin… what do you suggest?
Thanks
Peter

fluidmoon
Comment » October 16, 2007 @ 6:33 am

Activated the plugin and didn’t had permission
I followed the instructions from wordpress.org and it works now:

“You can fix this without altering any code.

1. Go to the Users page
2. Select your user ID
3. In “Update Selected” area, click “Set the Role of checked users to” and select “Administrator” from the pop-up menu
4. Click the “Bulk Upadate” button.

This also fixed my problem with the Related Posts plugin. ”

full entry here:
http://wordpress.org/support/topic/107823

Ryanair
Comment » October 30, 2007 @ 1:10 pm

problem with CSS on IE with this plugin

Frank Lucas
Comment » December 29, 2007 @ 7:42 pm

WordPress: v2.3.1
MySQL: v5.0.45-community-nt
PHP: v4.4.7
Server: Microsoft-IIS/6.0

Nothing could get it to show-up on any page, sidebar, etc.

Regards.

 

* Required field (e-mail is not published). Breaks and paragraphs are automatic. HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>