Tag Archives: PHP

Code

Infinite next and previous post looping in WordPress

infinit next previous post looping

It has happened to me several times in my career as a WordPress freelancer to be in need of a infinite next and previous post looping in WordPress. And I have a solution for that.

Read More
Code

Access an object as an array in PHP

php type casting

Have you ever been in that position when you are working with an PHP object and you need only one single peace of the data it contains and you want to skip all that iteration part and access that data directly. I have.

Read More
Code

Without a Plugin: Display Recent Comments

recent-comments
This post was originally published on April 9, 2009 and is now being being republished as it has been entirely revised. The original method is removed and now replaced by a new one.

WordPress ships with a Recent Comments widget, which is very handy, but on the other hand does not give you much freedom in terms of look and feel. There are plugins out there with will offer some more functionallity, but you sometimes feel you just want to free yourself form any limitations. So here I present the recent comments function. Let’s get our hands dirty.

Read More
Code

Easy PHP II: Variables

php-tux

In the previous introductory PHP tutorial we talked about what PHP looks like and in what kind of environment it runs. To sum up, we said that we write PHP code between tags that look like this: “<?php … ?>” and we end every command line must and in semicolon (;). We use “echo” or “print” in order for PHP to show things to us. We also said that we need to have Apache server, PHP and MySQL installed in our computer or server so that PHP can run and we concluded that using a ready-made package like XAMPP, WAMP, or MAMP to achieve that would be optimal. Today we are going to learn about PHP variables, their kinds and use.

Read More
Code

How to Limit Content in WordPress

speed-limit
This is an old article describing old-fashioned ways of limiting content. I’m publishing a new article on this topic very soon so make sure you subscribe below.

Have you seen those cool magazine style WordPress themes around this days? They are just cool. You might have noticed that they sometimes show a few words of the post, this is for sure not the default WordPress excerpt showing that because the default excerpt length is set to 55 words and manually excerpting every post would be a great time consumer. So, what are this guys putting together to get that cool effect on their sites by controlling the length of the content? Well, as a WordPress freelancer, I have been needing that feature myself and today I’m going to share with you how to have that feature on your site.

Read More
1 2