Jump to content

How To Add An 'contact Me' Page?


shriram

Recommended Posts

Hi ,

 

I am planning to add an 'about me' page and a 'contact me' page to my blog. The header file of my current theme contains the links to it and it has been disabled as of now. I want the link to be of this format "www.mistymusings.com/about/" when I hover above the link.

 

I tried using ryanduff's 'WP Contact Form' but I am facing issues when I try to configure it in the Options page. When i click on the 'Contact Form' link in my Options page, it gives me a 404 error saying 'The requested URL /wp-admin/options-contactform.php was not found on this server.' As per the docs, i dont need to place a options-contactform.php manually anywhere.

 

Any other related plugins or ideas on how to go about doing it would be really appreciated :P

 

Thanks in advance.

 

Cheers,

Shriram

Link to comment
Share on other sites

For you to have a link for your about page to look like that you would need to create a folder in your domain called "about" and place the page in that folder. The name of the page should be "index.php", "index.htm" or "index.html".

 

The problem you seem to be having with the Contact Form script looks like an older version of the script. It used to be located in the wp-admin folder. I downloaded, installed and tested WP Contact Form version 1.2 on my test blog and it works as advertised.

Link to comment
Share on other sites

On my WordPress blog, I actually have two ways to put a contact form.

 

The first, is what Bruce Suggested. I have the WPContact Form plugin (can be found here), which was very easy to install, allows you to set the options in the WordPress admin module, and allows you to insert a form on any page or post. Very sleek, and works exactly as advertised.

 

The second is the basic dodosmail script (can be found here) that I inserted into the body of a Page. This one requires a little bit more configuration in the php files, but it is much more versitile, and allows you to collect as much (or as little) information as you want.

 

Now, if you want your contact pages to be located at blog/contact then you should turn on permalinks. Under Options | Permalinks you put the following code in the first box:

>/%year%/%monthnum%/%day%/%postname%/

and leave the second box blank.

 

This will modify your .htaccess file so that the URLs look like they are based on date. The happy side effect is that your pages will all be referenced by /[slug-title].

 

For example, my blog is located at blog.paulpehrson.com and I have the permalinks enabled like I described above. I have a Page with the slug "contact", so if you go to http://blog.paulpehrson.com/contact you will be directed to my contact page. I have another page with the slug "terms-of-service", so if you go to http://blog.paulpehrson.com/terms-of-service you will be redirected to my TOS page.

 

When you click the Update Permalink Structure button, WordPress will attempt to modify the .htaccess file byitself. For this to work, the .htaccess file must be writable. In any case, I didn't get it to work such that WordPress could actually modify the .htaccess file, so here is what happens in that case: When WordPress can't automatically update your .htaccess file, then it spits out a list of code, and tells you that you need to copy and paste that code into your .htaccess file. It is easy enough, and you can do it in your cPanel File Manager.

 

Once you have done that, your link structure will have changed, and your Word-Press created Pages will be referenced in the URL as being in the root directory of your WordPress installation, with their page slug as the filename (but with no file extension).

 

I hope that information is helpful. Keep asking if we haven't been clear!

Link to comment
Share on other sites

Thank you so much Bruce and Paul :)

The information you guys provided was really helpful :)

 

I have now updated my permalink structure and have also modified the .htaccess file. So all posts have a neat [slug-title] which looks real cool :)

I have also activated the latest version of Contact Form and i am now able to customize it using the Options tab.

 

The problem i am now facing is this. I have created a contact folder under public_html and have placed one php file 'index.php' inside it containing "<!--contact form-->" (without the quotes). So when i type myblog/contact this php is being called & the form doesn't appear but a blank page appears. If i create a page instead of a post and type the same content, i can see the form when i am saving it preview mode. But am not sure as to how to save the page inside a dir from WP.

 

Am i doing something wrong?

 

Thanks again,

Shriram

 

On my WordPress blog, I actually have two ways to put a contact form.

 

The first, is what Bruce Suggested. I have the WPContact Form plugin (can be found here), which was very easy to install, allows you to set the options in the WordPress admin module, and allows you to insert a form on any page or post. Very sleek, and works exactly as advertised.

 

The second is the basic dodosmail script (can be found here) that I inserted into the body of a Page. This one requires a little bit more configuration in the php files, but it is much more versitile, and allows you to collect as much (or as little) information as you want.

 

Now, if you want your contact pages to be located at blog/contact then you should turn on permalinks. Under Options | Permalinks you put the following code in the first box:

>/%year%/%monthnum%/%day%/%postname%/

and leave the second box blank.

 

This will modify your .htaccess file so that the URLs look like they are based on date. The happy side effect is that your pages will all be referenced by /[slug-title].

 

For example, my blog is located at blog.paulpehrson.com and I have the permalinks enabled like I described above. I have a Page with the slug "contact", so if you go to http://blog.paulpehrson.com/contact you will be directed to my contact page. I have another page with the slug "terms-of-service", so if you go to http://blog.paulpehrson.com/terms-of-service you will be redirected to my TOS page.

 

When you click the Update Permalink Structure button, WordPress will attempt to modify the .htaccess file byitself. For this to work, the .htaccess file must be writable. In any case, I didn't get it to work such that WordPress could actually modify the .htaccess file, so here is what happens in that case: When WordPress can't automatically update your .htaccess file, then it spits out a list of code, and tells you that you need to copy and paste that code into your .htaccess file. It is easy enough, and you can do it in your cPanel File Manager.

 

Once you have done that, your link structure will have changed, and your Word-Press created Pages will be referenced in the URL as being in the root directory of your WordPress installation, with their page slug as the filename (but with no file extension).

 

I hope that information is helpful. Keep asking if we haven't been clear!

Link to comment
Share on other sites

i am really confused now. Should i delete the folder named 'contact' which i had created before (under public_html) which had the index.php like you mentioned and create a new contact.php having only "<!--contact form-->" ? Should i place this file in the same dir as my other theme files?

 

Thanks,

Shriram

 

Create the page as contact.php and place it in your root or theme WP folder.  That should be all you need to do.

Link to comment
Share on other sites

I think we are confusing you here by accident, and I think that the reason is because when we say "create a page", we don't mean "create a blank php document on your computer, add <!--contact form-->, save it, and upload it to your server." What we DO mean, is use the function within WordPress to create a page.

 

If you log into WordPress, and in the admin module, click on Write, you will see a row of sub tabs. On that row of subtabs, select the second tab, which is "Page".

 

In fact, here is a screen shot to show you better what I'm talking about...

 

post-1719-1125594303_thumb.jpg

 

Ok, so now look at the top red arrow. That is the page you should be on.

 

Notice how there is now a button on your post toolbar (second red arrow). Anywhere you click this button you will have a contact form that uses the parameters you set in your options module.

 

When you click the button the text <!--contact form--> is displayed in the text box. That is the precice location where the contact form will be displayed on the rendered page.

 

Now, you go down further on the page (third arrow), and give the page a slug. If you don't do this manually, then the page will be a hyphenated version of the title that you created. But you want this file to be located at something like "blog/contact" NOT "blog/contact-me", so you manually type "contact" in the box. This will give you the easier to type name (and it should then work with the button on your blog's main page).

 

Does that help better explain what we mean when we say "create a page"?

 

Best wishes.

Link to comment
Share on other sites

The problem i am now facing is this. I have created a contact folder under public_html and have placed one php file 'index.php' inside it containing "<!--contact form-->" (without the quotes). So when i type myblog/contact this php is being called & the form doesn't appear but a blank page appears. If i create a page instead of a post and type the same content, i can see the form when i am saving it preview mode. But am not sure as to how to save the page inside a dir from WP.

Shriram,

 

Ok, I should have completley read your question before I went out and wrote my reply. :) Sorry about that. I skimmed your post and didn't realize that you had found the "Write Page" functionality in WordPress.

 

Now I'm going to share with you my understanding of how Permalinks work in WordPress. I may be wrong. If I am, I hope somebody will correct me. I'm still quite new to the Permalink thing myself (only using it for a month or so). With that disclaimer, here we go:

 

Also, let me define some terms before we get started, so that when you read what I write, you know that we are on the same page. When I say "create a Page" I will be referring to using the Write Page functionality in WordPress, unless otherwise noted. Also, I'm going to refer to your blog location with a variable: $blogLocation$ to make it easier. This variable $blogLocation$ refers to wherever you have your blog installed. So if I say $blogLocation$/wp-admin, then you would go to the wp-admin directory at your blog's root level. If your blog were installed in blog.example.com, then every time you saw $blogLocation$ you would replace it with blog.example.com. If your blog were located at www.example.com/users/blog, then every time you saw $blogLocation$, you would replace it with www.example.com/users/blog.

 

Permalinks only work if there isn't content already existing in a folder on your site. So if you create a Page with the page slug "contact", and with Permalinks enabled as we described earlier in this thread, that page will be referenced in the following location: $blogLocation$/contact. WordPress doesn't actually create a folder named "contact" at that location, but the .htaccess file knows that when you try to access $blogLocation$/contact, then you should be redirected to $blogLocation$/?page_id=x (where x is the page ID number for the page you are looking at). There is a problem then if you have a directory called "contact" at $blogLocation$ (meaning that if you were to go to your blog's directory in your File Manager, you aren't allowed to create a directory called "contact") because the .htaccess file won't know when it is supposed to show the files you've uploaded to the "contact" directory, or when it is supposed to show the page you created in WordPress with the page slug "contact".

 

Does that make sense?

 

For this reason, you SHOULD NEVER create a page with the page slug of "wp-admin" or you will never be able to access your admin panel. This would be what we call A Bad Thing.

 

Also, when you are naming page slugs (and post slugs, for that matter), I recommend that you only use numbers, lower-case letters, and hyphens. (There are probably more characters that would be allowed, but if you stick to these ones, I guarantee you'll be safe.)

 

(Wow. I'm feeling long winded today. This should count as two posts...)

 

Ok. So back to what you said. For all of this to work, yes, you do need to delete the "contact" directory and all of its contents. Then you should make sure your Page has the Page slug "contacts". Then you should be set.

 

I have more advice about creating Pages that don't show up in the menu bar, but I've already said too much today, so if you want more info on that later, let me know.

 

I hope this has been helpful, or I will have wasted a whole bunch of time!! :) But if it helps, it will have been worth it.

 

If you are still unclear on anything Bruce or I have said, please post back, and we'll try to un-mud-ify our responses!!

 

Best wishes,

Link to comment
Share on other sites

Hi Paul,

 

Thanks a bunch once again for taking time and explaining everything in detail. I very much appreciate the efforts that you have taken to explain the permalinks concept to a WP newbie like me.

 

I have now understood the concept behind permalinks and so have deleted the contact folder and the files inside it. Still i am facing a problem.

 

When i am composing a page, i am able to find the form at the end of the page (preview section) and i save the page name as contact with the slug as contact again so that i can access the page at http://www.mistymusings.com/contact/ the only problem is that once i save the page i am not able to view the page at that location. i get a 404 error as WP is not able to find the page.

 

i have a few questions here. hope am not bugging you too much :)

 

1.If a page is similar to a post, then wouldnt it have a format just like a post if permalinks were enabled. (i.e) shouldn't i search for the contact page at http://www.mistymusings.com/2005/09/02/contact/ (or something like that though i agree it doesnt make sense this way)

2.Where are all the posts stored? WP has been installed at the root folder in my system. I know that the content of the posts is stored in the mysql DB but where r the files stored physically? Or is it something like its created dynamically everytime a request is sent by taking the content from the DB?

3. Should i categorize my contact page and if i do , i get the page even when i am searching for posts filed under the same category. i dont want this page to show up anywhere else apart from where it is required (the link in my header page)

 

hope my questions make some sense atleast :)

 

thanks a lot in advance ...

 

Cheers,

Shriram

 

Shriram,

 

Ok, I should have completley read your question before I went out and wrote my reply.  :blush:  Sorry about that. I skimmed your post and didn't realize that you had found the "Write Page" functionality in WordPress.

 

Now I'm going to share with you my understanding of how Permalinks work in WordPress. I may be wrong. If I am, I hope somebody will correct me. I'm still quite new to the Permalink thing myself (only using it for a month or so). With that disclaimer, here we go:

 

Also, let me define some terms before we get started, so that when you read what I write, you know that we are on the same page. When I say "create a Page" I will be referring to using the Write Page functionality in WordPress, unless otherwise noted. Also, I'm going to refer to your blog location with a variable: $blogLocation$ to make it easier. This variable $blogLocation$ refers to wherever you have your blog installed. So if I say $blogLocation$/wp-admin, then you would go to the wp-admin directory at your blog's root level. If your blog were installed in blog.example.com, then every time you saw $blogLocation$ you would replace it with blog.example.com. If your blog were located at www.example.com/users/blog, then every time you saw $blogLocation$, you would replace it with www.example.com/users/blog.

 

Permalinks only work if there isn't content already existing in a folder on your site. So if you create a Page with the page slug "contact", and with Permalinks enabled as we described earlier in this thread, that page will be referenced in the following location: $blogLocation$/contact. WordPress doesn't actually create a folder named "contact" at that location, but the .htaccess file knows that when you try to access $blogLocation$/contact, then you should be redirected to $blogLocation$/?page_id=x (where x is the page ID number for the page you are looking at). There is a problem then if you have a directory called "contact" at $blogLocation$ (meaning that if you were to go to your blog's directory in your File Manager, you aren't allowed to create a directory called "contact") because the .htaccess file won't know when it is supposed to show the files you've uploaded to the "contact" directory, or when it is supposed to show the page you created in WordPress with the page slug "contact".

 

Does that make sense?

 

For this reason, you SHOULD NEVER create a page with the page slug of "wp-admin" or you will never be able to access your admin panel. This would be what we call A Bad Thing.

 

Also, when you are naming page slugs (and post slugs, for that matter), I recommend that you only use numbers, lower-case letters, and hyphens. (There are probably more characters that would be allowed, but if you stick to these ones, I guarantee you'll be safe.)

 

(Wow. I'm feeling long winded today. This should count as two posts...)

 

Ok. So back to what you said. For all of this to work, yes, you do need to delete the "contact" directory and all of its contents. Then you should make sure your Page has the Page slug "contacts". Then you should be set.

 

I have more advice about creating Pages that don't show up in the menu bar, but I've already said too much today, so if you want more info on that later, let me know.

 

I hope this has been helpful, or I will have wasted a whole bunch of time!!  :thumbup1:  But if it helps, it will have been worth it.

 

If you are still unclear on anything Bruce or I have said, please post back, and we'll try to un-mud-ify our responses!!

 

Best wishes,

Link to comment
Share on other sites

Finally I figured out the reason for my getting a 404 error.

 

I had to change the file permissions of the .htaccess file to '666'. I didnt try doing it earlier i had changed the contents of the file to enable permalinks.

 

Thanks a lot for your replies :dance:

 

-Shriram

Link to comment
Share on other sites

When i am composing a page, i am able to find the form at the end of the page (preview section) and i save the page name as contact with the slug as contact again so that i can access the page at http://www.mistymusings.com/contact/ the only problem is that once i save the page i am not able to view the page at that location. i get a 404 error as WP is not able to find the page.

So, is this problem now solved? From the update later in the thread, it sounds like you may have solved this problem. (And when I went to your site, I was able to view the contact page at the above address.)

1.If a page is similar to a post, then wouldnt it have a format just like a post if permalinks were enabled. (i.e) shouldn't i search for the contact page at http://www.mistymusings.com/2005/09/02/contact/ (or something like that though i agree it doesnt make sense this way)

I understand what you are saying, but this is exactly how "posts" are different from "pages." A "post" is considered to be more of a journal entry--it is specific to a particular date. A "page" is considered to be more permanent, and is not tied to a particular date.

 

Thus, in the WP file structure, posts use a date format (like $blogLocation$/2005/09/02/<post-slug>/ -- because the post is tied to that date.

 

However, a terms-of-service or a contact page aren't linked to a particular date, so they are created as pages. In the WP file structure, pages don't use a date, they just link of the blog root location; a page with the slug name: "contact" would be found at:

$blogLocation$/contact/

 

So, yes, Pages and Posts are similar in basically every way except how WP stores them or accesses them in the file structure. And because of this, pages don't show up in the archive or in category views.

2.Where are all the posts stored? WP has been installed at the root folder in my system. I know that the content of the posts is stored in the mysql DB but where r the files stored physically? Or is it something like its created dynamically everytime a request is sent by taking the content from the DB?

Posts are stored in the database, and the pages are created dynamically every time a request is sent for a URL. Basically, as I understand it (and I'm still new to this too, so I may be wrong here), when Permalinks are enabled, the .htaccess file is rewritten so that when users try to access a URL (like $blogLocation$/2005/09/05/wow ), the .htaccess file queries the database for the requested post, and the resulting file is displayed browser, with the URL in the address bar as requested. So, even though there is no 2005/90/05 directory in your $blogLocation$ directory, the .htaccess file makes it LOOK like there is.

 

But, yes, the pages are created dynamically, and the Permalinks are basically a smoke screen that hides whats going on behind the scenes.

3. Should i categorize my contact page and if i do , i get the page even when i am searching for posts filed under the same category. i dont want this page to show up anywhere else apart from where it is required (the link in my header page)

If you are creating a "page" using the "Write Page" tab, you shouldn't be able to categorize it. If you view this attachment that I used earlier:

 

post-1719-1125594303_thumb.jpg

 

You will see that there isn't a place to categorize posts. If you are able to assign it to a category, then I think you must be on the Write Post tab, not the Write Page tab. (Click back and forth between those two tabs to see the difference). Maybe you could write back (and maybe include a screen shot) if you are still having this problem--but as far as I can tell, if you use the Create Page tab, you won't be able to assign a category to the page.

 

I hope this is being helpful. Let me know if I need to explain it better, or if I can help further.

Edited by abinidi
Link to comment
Share on other sites

Thanks for your patient and detailed reply Paul :)

 

The 'contact page' problem has been solved & I have been able to set up a contact page now.

 

I kinda thought that the pages were created dynamically every time a request was sent. You are right about 'page categorization' as well. I am not able to categorize a post :oops: - my mistake.

 

Your reply was really helpful in understanding some basic concepts about WP !

 

Thanks once again :)

Shriram

 

 

So, is this problem now solved? From the update later in the thread, it sounds like you may have solved this problem. (And when I went to your site, I was able to view the contact page at the above address.)

 

I understand what you are saying, but this is exactly how "posts" are different from "pages." A "post" is considered to be more of a journal entry--it is specific to a particular date. A "page" is considered to be more permanent, and is not tied to a particular date.

 

Thus, in the WP file structure, posts use a date format (like $blogLocation$/2005/09/02/<post-slug>/ -- because the post is tied to that date.

 

However, a terms-of-service or a contact page aren't linked to a particular date, so they are created as pages. In the WP file structure, pages don't use a date, they just link of the blog root location; a page with the slug name: "contact" would be found at:

$blogLocation$/contact/

 

So, yes, Pages and Posts are similar in basically every way except how WP stores them or accesses them in the file structure. And because of this, pages don't show up in the archive or in category views.

 

Posts are stored in the database, and the pages are created dynamically every time a request is sent for a URL. Basically, as I understand it (and I'm still new to this too, so I may be wrong here), when Permalinks are enabled, the .htaccess file is rewritten so that when users try to access a URL (like $blogLocation$/2005/09/05/wow ), the .htaccess file queries the database for the requested post, and the resulting file is displayed browser, with the URL in the address bar as requested. So, even though there is no 2005/90/05 directory in your $blogLocation$ directory, the .htaccess file makes it LOOK like there is.

 

But, yes, the pages are created dynamically, and the Permalinks are basically a smoke screen that hides whats going on behind the scenes.

 

If you are creating a "page" using the "Write Page" tab, you shouldn't be able to categorize it. If you view this attachment that I used earlier:

 

post-1719-1125594303_thumb.jpg

 

You will see that there isn't a place to categorize posts. If you are able to assign it to a category, then I think you must be on the Write Post tab, not the Write Page tab. (Click back and forth between those two tabs to see the difference). Maybe you could write back (and maybe include a screen shot) if you are still having this problem--but as far as I can tell, if you use the Create Page tab, you won't be able to assign a category to the page.

 

I hope this is being helpful. Let me know if I need to explain it better, or if I can help further.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...