Tag: snippet

  • Working with paginate_links

    It is no secret that I try to advocate the use of core functions when possible. The idea of maintaining less code is a great one for any developer. It’s the old set it and forget mentality. What I do see a lot of is the use of my_theme_pagination that uses get_pagenum_link in order to get…

  • Using active callbacks in the Customizer

    One thing I haven’t seen many themes use is active callbacks to their advantage. What are they and how can they used? It’s actually quite simple and there are two methods that the customizer has available. The first one is when you first create the section, panel, or control. Great! We have a section but…

  • Two or three column section

    A while back I wrote a quick and dirty tutorial on how to display more than one page. This can be done in a number of different ways. You can read about them in other tutorials and guides because this time I’ll go over another method using the WP_Query method. The codex page some really…

  • Widgets and when to use them

    Widgets are a great way of showing information in specified areas. Themes handle this in different locations and different ways. Some have page template with up to thirty widget areas. Yes, thirty! Sorry, felt like a salesman when I typed it out but it is true. And then you get the occasional theme that wants…

  • Customizer: dropdown category selection

    Using the get_categories function with the customizer can be tricky. This is a code snippet to help out.

  • Fun with template tags: comment_form

    This time I’ll focus on the comment_form(). Neat, fun and with plenty of hooks and filters. The code Like usual we will look at the core code of the comment_form. There are approximately 230 lines of code that make up this template tag. Does sound like a lot, right? Yes, but when you look a…

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

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