Category: Code

  • Fun with template tags: comments_template

    On my last post I talked about dynamic_sidebar and some uses. It was a fun little experiment I wanted to do and share. Yes, I said experiment. That is how I learn. I read, do and then share. I know I’m not the only one that does that. This time I dabbled with comments_template(). Yes,…

  • Fun with template tags: dynamic_sidebar

    The last couple of weeks I’ve been reading the core code more and more. I like it. Came to the conclusion I really don’t know every hook or filter. I don’t claim to though. I like knowing enough to make a functional theme or even a plugin. Yes, I’ve been recently dabbling with one but…

  • Using the_post_thumbnail

    For some time I’ve noticed one thing that many people like doing. Recreating core functions. One being the_post_thumbnail(). The reason it drives me crazy is because it means maintaining more code in your theme. Why would you do that to yourself? One of the common things is to wrap it in a conditional check and…

  • 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…

  • Validating your theme’s settings and options

    You’ve made a theme and it has all the options you want to include. The next step is making sure that user input is the right information or at least what you are looking to use. Why? Security is a big thing and I mean a big thing. If you think it’s not I will kindly…

  • 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…

  • 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…