I decided to create my own theme b/c I wanted to do my own thing and, like it says in the documentation, it's a great way to learn WP and PHP. Oh, I'm learning all right...in fits and starts. I will admit I posted this on the WP.org forum and got zero response, so apologies if you saw this before.

I'm starting to understand PHP better and template tags and so on. I'm using Bootstrap, but that really shouldn't impact what I'm trying to do (i don't think).

I'm mainly concerned with the header and particularly the nav. If I can figure out the wp_nav_menu to do what I want it to do, I'll be much further along. Here's the HTML for my navigation (navbar-special is a class I created for an image-based navbar):

I know the PHP doesn't really explain much, but I don't want to paste in a ton of code and make this post look even worse. I have lots of other questions, but some help here would be HUGE. Thanks in advance Sitepoint Peeps

Pullo
—
2012-11-11T13:18:11Z —
#2

Hi there,Do I understand you correctly, that you are trying to take the nav bar from the HTML page you link to and implement it in WordPress?

coolpillows
—
2012-11-11T17:12:02Z —
#3

That's pretty much the idea. An image based nav, in WP, using Bootstrap to line everything up nice. Does that make sense?

coolpillows
—
2012-11-11T17:33:57Z —
#4

BTW, these are the relevant classes from the CSS; the rest are handled by navbar

This shouldn't be too difficult to implement.You write in your first post that you've decided to make your own theme.How far along are you? (just so that I know where to jump in).If you have started coding, have you got as far as the menu area yet?Are these the only four menu points you have / will have?Would you have anything against hard coding the menu into your theme, or do you want the ability to edit the menu from within your WP backend?

coolpillows
—
2012-11-11T19:59:13Z —
#6

Thanks Pullo. I'm just working on a static home page like it shows in the prototype; my blog will be off of that home page. Yes, I am as far as the menu, but it's not showing up in WP. (Actually currently, I'm swapping in and out different themes to just learn what I can and try things out.) I do have it set up under Settings > Readings for a static front page and then a blog. Those are the 4 menu options, but I don't want home on the menu as the user could get back to home by clicking the header banner.

As far as hard coding, I have no problem with that; I just want it to work. OTOH, I might expand this project and, maybe maybe, this would be a theme someone else might use. Not intending it for that purpose, but there should be an ability to do both. Just to be sure, when you say through the WP backend, you mean in the Administration screen Appearance > Menus.

Hope that makes sense and thanks again!

Lee

Pullo
—
2012-11-11T20:13:49Z —
#7

Hi Lee,

Then first of all, let's just port the page, as it is, to WordPress, so that you can see how all of the parts fit together.Here are some instructions to follow:

Create a new folder in your WP themes folder. Name it test.

In this new folder (wp-content/themes/test), create the following files: header.php, index.php, footer.php, styles.php.

Copy and paste the following code into the respective files and save it.

<?php get_header(); ?>
<div class="span12">
<div class="row">
<h1>This is me.</h1>
<h3>Just launched, so I'm still figuring out what's going on here. But basically it's what you see up there, a Blog about things related to User Experience, Technology and various amusing musings on our Weird World. Humor is humor; Consulting is about my professional life. </h3>
<h3>Below are two highlights from the funny side of things. The Museum of Marketing Madness is my curated collection of Bad Advertising, Marketing and other messaging, I'd call it the Awkward Family Photos of Advertising and Marketing, a curated collection of ads I find that should be held aloft for observation and ridicule. </h3>
<h3>I am so smart, I'm an idiot is a fictional blog (F'BLOG, my own term). Did you ever read a blog written by someone you don't know talking about stuff you've never heard of and doing things you can't believe? Well, then this blog is for you. This is written by an obsessive blogger who, starting at the beginning of time, has been blogging about a bunch of stuff nobody cares about, nobody knows about and people no one ever knew. You may recognize some of the people, but that's only because you too have wandered into blogs written by someone you don't know talking about stuff you never heard of. </h3>
<p>then a p tag w/more stuff, rss feed, blah blah</p>
</div><!-- end row -->
</div><!-- end span12 -->
<div class="span12">
<div class="row">
<div class="span6"><a href="#"><img src="http://www.leesachs.com/testing/madnessmuseum.jpg" /></a></div>
<div class="span6"><a href="#"><img src="http://www.leesachs.com/testing/idiot.jpg" /></a></div>
</div><!--row -->
</div><!--span12 -->
<div class="span8 offset4">
<h6>This site is a the property and the sole creation of Lee Sachs, upon whom this domain is named and wherein all which therefore shall be mine all mine, so don't steal it. Be nice. I was here first. Please link here and let me know if you do, but don't plagiarize or I will hunt you down like the dog that you are. That is if you plagiarize. You are only a dog if you plagiarize. If you don't, then you can be any animal you want.</h6>
</div>
<?php get_footer(); ?>

footer.php

</div><!--container-->
</body>
</html>

coolpillows
—
2012-11-11T20:46:18Z —
#8

pullo...i gotta run out for a bit, but i'm going to do what you're saying and get back to you. stay tuned...although it might be very late for you if you're in germany, you'll have something to wake up to. danke!

Pullo
—
2012-11-11T20:53:12Z —
#9

Yeah, no problem at all.All the code I posted does is recreate your static page within WP, nothing terribly exciting.Once you've got that working, we can go from there and make things more dynamic.

coolpillows
—
2012-11-12T04:41:52Z —
#10

okay man, got you covered. i know WP is gonna want a functions.php file and so on. but it's a place to start...think i see where you're going. but enough for now.

Pullo
—
2012-11-12T08:10:12Z —
#11

coolpillows said:

okay man, got you covered. i know WP is gonna want a functions.php file and so on. but it's a place to start...think i see where you're going. but enough for now.

Guten morgen,

So, hopefully you have done what I suggested and have seen that you now have a perfectly static copy of your original page within WP.While this is cool, it is also pretty useless. Now you need to make your site dynamic, so that you can use WP to edit its content.

The first thing to look at is the menu. Essentially you have five pages: blog, humor, consulting, contact and home.Go to "Pages" on your WP dashboard and create blank pages with these names.Then go to Settings -> Permalinks and change the link structure to "Postname"Now edit the menu code of header.php as follows (this assumes that your WP site resides at http://domainname and not http://domainname/wordpress/, for example):

Now you should be in a position to add content via the WP dashboard and have a (albeit very basic) working site.

If you have any questions, just let me know.

P.S. I'm not suggesting that you go live with this, it is merely intended to demonstrate how to fit some of the pieces together to achieve what you want.

coolpillows
—
2012-11-12T23:26:45Z —
#12

ok...i will make those changes later tonight (while you are probably sleeping). i'm already sorta seeing where you're going, but let me see what i can figure out...will check in tomorrow.

ciao....

coolpillows
—
2012-11-13T03:03:51Z —
#13

Guten morgen!

Pulli - I totally get what you're doing. So the menu is hard coded into the site. And maybe this is just as well. For the life of me I don't see a plugin or a way to cleanly have a navbar that uses images instead of text. This method for now might just work. Need to understand more but making progress!

Lee

Pullo
—
2012-11-13T08:30:40Z —
#14

Hi Lee,

Making a dynamic menu with images is not at all hard. You would just do the following:

Copy all of your CSS styles into style.css, then style your menu as desired (with images or whatever).Simples!

Hope that helps.Hit me up if you have any questions.

coolpillows
—
2012-11-13T15:19:27Z —
#15

Pullo -

(sorry i called you Pulli last night). This rocks. You rock. Sitepoint Rocks. As I mentioned before, I posted this on the WP Forums and nobody replied. I'm going to play around some more and see what other trouble I can get into.

I'm going to take a wild guess and assume that I don't have to use the description => "My Badass Menu."

I'm going to take a wild guess and assume that I don't have to use the description => "My Badass Menu."

No, you do. This is a WordPress naming convention and if you break it, your site will stop working.

Anyways, good luck with this. If you run into any more trouble, just let me know.

coolpillows
—
2012-11-14T15:59:56Z —
#17

okay...not quite there. don't know why. did what you said, but not seeing the menu unstyled or otherwise.

I'm trying to figure it out on my own, and I think it might have something to do with either what the description is in functions.php or the dynamic_sidebar('Menu') in header.php or something else. Yes we joked about the name "My badass menu" which I left in, but should it be changing that to the new name of the menu I created in the WP Appearance>Menu screen which is, in fact, "FoldersMenu?" Let me know what you think. You can view it online if you want or if you want to mess around I guess I can give you a profile to go into the blog itself, but I doubt that's needed. Thanks again, in advance!

Lee

coolpillows
—
2012-11-14T17:37:37Z —
#18

Actually, I got the menu to appear unstyled now, by dragging the Custom Menu widget under the Menu widget that's on the right. I've definitely changed the stylesheet to include all the bootstrap styles, so that's all working. I also added the php function to call the style sheet in header.php.

I'm not seeing the folder tabs that I had in my menu when it was hard coded. I was able to follow your instructions, but then didn't see an unstyled menu at all (at first). But then I was able to get it to show up. For now, though, the styles are not being picked up. Why is that? (hope that's clear enough). Danke!