Tag: code

  • JavaScript in PHP

    Lately I’ve been seeing a few themes that like to include and devote an entire file to JavaScript. There is a reason I don’t like this. Biggest one is because it creates bad practices. Yes, I understand you want to pass some variables between the two languages but there are better ways. What’s super cool…

  • Displaying multiple pages on one

    Every so often I come across a theme or an implementation I like and wonder how it is being done. I like to dig behind the scenes on themes and see how they do things. Taking things apart to see how they work is a great way to learn. One neat little tidbit I learned…

  • Making a Portable Object Template for your WordPress theme or plugin

    Yes, a bit of a lengthy title but I feel will get the point across and it is after all what I’m wanting to share with you today. A what now? A .pot ( or a Portable Object Template ) file is what WordPress uses and many PHP programs use for translation purposes. There are…

  • Keeping count of reviews

    I hate posting this but I have to do it; sort of a status check for myself. To see where I stand and where I can be better. We all do it. I choose to do it publicly. I can’t recall when I said I wanted to have my review count to be at 500…

  • Making a few commits

    Let me give you a little bit of a back story first. 2 years ago I began posting on the WordPress.org forums to help people out. I would only post on things that I knew for sure I knew the answers to or would help out. It felt like it at the time. Who knows…

  • Child theme friendly post-formats

    It’s no surprise I will always preach the making of child themes. Part of the reason is because you can make modifications without losing all that when it comes time to update the parent theme. I mean nothing more exciting than having to recall what files you changed, what code you added, deleted to brighten…

  • Getting the image count in WordPress

    A long time ago I had a bit of an issue on how to get the image count from a post. At the time there wasn’t a way that I could think of to properly getting all the needed information; but then again I didn’t know as much as I do now. I wanted to…

  • You don’t know text

    Okay, maybe you do but what I’m talking about is a different kind of text. I’m talking about text strings in PHP code. Text strings What are they? Why do they matter? Well, they matter in themes that you want to make public or share. Oh, and plugins as well, I guess. If you’re into…

  • Dealing with menu items

    I feel as though this subject is a bit different than what I’m used to. To a certain degree it is. I’ve never really dabbled much with the menu class within WordPress. I mean I used the wp_nav_menu template tag once or twice but never really looked as to how it works. That was until…

  • Playing nice with plugins

    Yep, you read that right. Playing nice. With plugins. I know what you’re thinking and are probably wondering what I mean by that. Don’t lie You know you want to ask. What do you mean by that? What I mean is that as a themer you shouldn’t be adding frivolous things to your theme. What…