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

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

How do I remove these classes (I think?) from my Wordpress site?

Site: backroadsbrewing.com

Trying to remove: "Home" (in nav) and "Nothing Found. Ready to publish your first post? Get started here." (below the fold)

I tried getting into the theme's stylesheet, but I'm not sure if I'm just not finding it because I'm working in a child theme. I want to remove all instances of menus (such as the "Home" menu item in the top nav) and the post that's just below the fold that says "Nothing Found. Ready to publish your first post? Get started here."

That latter one appeared when I deleted all pages and left just the header. For some reason, it left that in its place. I tried to inspect the elements in the Dev Console, but the code it's showing me are ones I can't find in Wordpress Editor (stylesheet, for example).

Any ideas?

6 Answers

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

Ha ha! Totally! I can find my way around FTP okay, but just not sure how to recognize the parent folder (assuming that's where I need to access the classes)? Or can I just go right for the child theme? I know the problem with changing the parent theme is that any update could override the changes I make, so I'm assuming child theme is best to work in. But then, I'm wondering why I can't find those classes in the stylesheet located natively in Wordpress' dashboard editor, since there is a stylesheet there! Hmmm... stroking my non-existent beard in contemplation

That's kinda the beauty of a child-theme, you will overwrite the styles in your child-theme's style.css file. To check what you are using FTP into the site, and go to the themes folder, htdocs > wp-content > themes. there you should see several folders, one will be the parent and the child will say the parent name then a - symbol followed by the word child, ie XYZ-child. that will be the child theme. if you don't see that then you are working from a parent theme. Honestly, there could be a number of reasons why the styles are not being added via the dashboard. Are your new styles at the bottom of the page? do you see other CSS styles in the editor? You don't need to find the classes, what you need to do is overwrite the base styles, and since CSS cascades much like the name CSS your new styles won't be applied due to CSS cascading scope.

Does the stylesheet in the dashboard say bla bla theme-child in the comments? It also could be that the stylesheet is 100's of lines long and there is a lot of code there.

did you go to the backend and inside menus remove home from the primary nav?

Gina Bégin
Gina Bégin
Courses Plus Student 8,613 Points

Yes, I did. I ended up adding some CSS to the menu WP "Appearance > CSS" WSIWYG menu to hide it both of these elements, but I'm still unsure why I couldn't just find it in the code to remove it.

Now I'm trying to figure out how to put a margin in the header for the logo and in the footer for the contact info so the left side of both of these elements are aligned with the text in the main part of the screen. I've jumped into the CSS stylesheet again and played with the margin-left values to try to bump it over, but nothing is changing. I'm wondering if it has something to do with working in the child theme? I know the name of the parent theme, but I don't have it installed in my site, so I don't know how to edit (if that's even what's going on, of course. : )

From your site, it looks like you are using the 2017 theme, There are two ways to removing the menu if you want. After looking at your site, it looks like you are using index.php to display the homepage, look inside the header element and you will see the divs plus the WP call to WP_nav_menu() there you can just delete the menu. Or you can use this function unregister_nav_menu( 'primary' ); at the bottom of your functions.php file. this will unregister the primary nav.

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

Hey Jacob! Thanks—2017 might be the parent theme (?) but Velux is the theme we're on right now. However, the solution might be the same. I'll take a look — I was able to get it working with the solution I provided above, though it might not be the best! :)

Would you know how to fix the second part of my reply (above)?

you are using a child theme right? In the child themes' style.css file you can style the required class name. Not sure what you want to do in the second part of your question. Do you want the Her text to be aligned left like the logo and pho number or move the logo and phone right to align with the hero text?

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

Thanks Jacob; I'll check there. For the 2nd part of the question, I'd like to push the logo and phone number (and copyright all the way at the bottom, if possible) to the left so it's aligned with the text in the main part of the site (I think it's the hero text, but basically, the part that says "We're open!" and then is followed by hours open). I tried setting left-align margins and some other things, but nothing has worked so far.

have you used chrome dev tools to test the look of this and to see what class names you can use to have your CSS work? This is the best way to find out what is there if you don't have the parent theme files locally.

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

Hey yeah; I wrote a little about trying to do that in the original question, but wasn't able to find those classes in the child theme. They may be in the parent theme, but I don't know how to access that via WP (hosted through "Managed Wordpress" in Go Daddy. Would it just be part of the file structure if I accessed it in FTP? I can give that a go; was just hoping it was something I could pull up natively in Wordpress' editor.

You are not using a text editor like sublime, you are using an options page in the backend of WordPress?

Are you working on this locally? or on the live site?

I highly recommend you using FTP to pull the sites htdocs file down locally, and working using MAMP.

If this is a no go, then what you can do as a "last" resort is to scroll down to the bottom of the style sheet in the backend of WordPress copy and paste the classnames from the devtools and write your CSS there, but only as a last resort. It is not considered best practice to do this.

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

Right, in this particular site, I'm just editing in the dashboard of Wordpress; I've only used Filezilla once on this particular site. I've used it in the past with another project I was doing side-by-side with Treehouse lessons, but I was trying to get back into the swing of things with helping my friends with their website (and hoping it was going to be simple — but it's turning out to be a little more difficult than I remember! :)

Hey, no worries, I'd be happy to help you using FTP if you want, you just need to know all the server info. Yeah, its always the case, something seems easy, then all hell breaks loose.

are you using a mac, or pc?

do you have MAMP locally installed?