how-to

WordPress: How to display all posts in one page

Although displaying all your latest posts in Wordpress may seem like a no-brainer (after all, the default home page already displays your “Latest Posts”), doing so is kind of tricky if you are trying to do it in on a custom page.

Here’s a little code that can help you accomplish that.

How to automatically add tags to WordPress posts

In WordPress, if you need to automatically add tags to a post via a PHP script, the best way to do it is via the wp_set_object_terms() function. There is no handy “wp_insert_tag()” function, or something like that, so look no further.

How to load CSS stylesheets dynamically with jQuery

Sometimes you may want to load a CSS stylesheet dynamically after your HTML page has loaded and certain conditions are met (for example, if an element with a specific class exists in the DOM). jQuery can help you accomplish that with a few lines of code, helping you save some bandwidth and make your page load faster.

How to center divs within a page with CSS

Sometimes you may want to center a div element within a page, whether vertically, horizontally, or both (dead center). Here’s how you can accomplish all of that using CSS.