Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Not sure how to take an activated plug in and edit it

We had a contact form 7 set up and active on our site. It is working fine, but what I am interested in is being able to see from which page a visitor is sending this form from, that way if they do not fill out all fields of the contact form (even though it is required), we have some sort of idea of how to track which page they were looking at. Is that a possibility?

Thank you!

6 Answers

Brian Hayes
Brian Hayes
20,986 Points

You can accomplish this by creating duplicate forms for each individual location on the site and using an appropriate naming convention. Then either in the mail section of the form edit screen you can choose a place to manually add the location of the form, as I do not think there is a dynamic tag to use. For example, for the form on a "Contact Us' page, you can add "Sent from the 'Contact Us' page contact form." in the message body. You could even edit the statement that is already there and just make it more specific.

The only other way I could think, if you wanted to make the process more dynamic would be to add some custom code that uses WordPress functions to get the page name and store it into a usable shortcode that can be added to email, but having never tried anything like that I don't know how viable or worth your time something like that would be.

Thank you so much for the response, Joey! I am very new to WordPress and of course do not code. How would I go in and do that for each individual form? SO sorry!

Brian Hayes
Brian Hayes
20,986 Points

On the main page listing all the contact forms you have you can hover over a form title and you'll see "Edit | Duplicate" pop up under it. You can go ahead and duplicate it as many times as you want. Just make sure to rename them in a way that you can easily figure out which form goes to which location. Then to add the identifier for each one, you would have to hit "Edit" (or just click the form title) on each one and then go to the "Mail" tab and type in the page name in the message body meta box.

That way when the plugin takes the form input and emails it to you each form has its own identifier in the body of the email. You could put it in the message subject if you want as well, but that could make for a long subject line.

Joey, you're amazing and I love you

Brian Hayes
Brian Hayes
20,986 Points

It's no problem at all. It really wasn't very long ago at all that I was in your position, so I'm happy to share what I've learned from experience and from here at Treehouse with others.

Hi Joey. I hope you can help with another issue. When viewing my company's website on a mobile device, the logo is not visible, but instead, it says the word "Total". Not sure why this is doing this and how. It is only on smart phones. Viewing on an iPad or computer it is fine. Have you ever come across this before? Thanks!

Brian Hayes
Brian Hayes
20,986 Points

This can either be due to your theme, or a plugin such as WPtouch. It's tough for me to say exactly what is creating this issue without knowing the configuration of the site, but I can offer a few examples where this might happen.

First thing you should do is check if you have any plugins installed related to making your site "responsive" or "mobile-friendly/optimized." If you happen to have any, then check their settings to see if there is an option you can change. Next, if that is a dead end, or you have no plugins of that type, check both your options in the customizer under the appearance menu. Lastly, if your theme has an options page, then check there.

In the case of a theme, most likely the CSS of the theme uses Media Queries to detect viewport width and executes styles based on what is set. This could mean that you have items in the HTML markup that change in their display property depending on screen width. In this case, the theme makes it so the logo has a display: none value on small screen sizes.

In my most recent theme I've been building for a client, I utilize two different menu markups. One specifically for mobile, and the other for medium size screens (tablets and up). The markup for both are in the actual rendered HTML, however due to special CSS classes, once a user goes beyond the max width I have set, the mobile menu is hidden, and the menu meant for bigger screens appears.

There have been many themes that employ a responsive approach like this one, however, when they created the markup for the mobile menu, the site title is displayed as oppose to the logo. Whether a theme employs specific menus, or just a fully responsive all-in-one type menu, it most likely comes down to the CSS.

The Simplest way to try and fix this would be using a simple child theme with the required CSS tweaks included in 'style.css'. This could also be accomplished with a plugin that allows you to add CSS to your site, but I tend to find child themes much easier to manage.

on an extra note: You may also want to check if the site is responding to media queries, or using some form of device detection via JavaScript. Open your site up in a browser window, and then resize that window to as thin as it can go and see if the menu flips as you do it. If it does, then it should come down to the CSS of the theme.