How to get IP address without a plugin? I just want to run a couple of conditionals depending on a visitor's IP address. How would I do that?
From PHP:

if (craft()-&gt;request-&gt;getIpAddress() == '255.255.255.255')
{
    ...
}


Note from the docs that this is a "best guess" and can easily be spoofed, so you shouldn't use it to hide any sensitive information.

We currently don't expose that method at the template level, but we probably should. I'll add that on the Craft 2.3 branch.

If you want to hack it in before then, you can open up craft/app/variables/HttpRequestVariable.php and add:

public function getIpAddress()
{
    return craft()-&gt;request-&gt;getIpAddress();
}


Then from a template you'd use:

{% if craft.request.getIpAddress() == '255.255.255.255' %}
    ...
{% endif %}


Just note that there is a chance that a 2.2 update could overwrite that file at any time.

UPDATE: No hack is required since Craft 2.3.2615.