Welcome To Snipplr
Everyone's Recent Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
this is how to automatically get short urls for your blog posts in wordpress,
What you need
is to decide which tinyurl service you will be using and get its api URL,
for example rinyurl.com , bit,ly, tr.im,
here are the api URLS for the mo...
0
901
posted 15 years ago by nerdsane
This is a snippet to assign an active class to active links when the navigation is included in a php file.
1
705
posted 15 years ago by grazz
This snippet returns a link to twitter for the user to tweet the current page. URL is TinyURLed automatically (and tinyurls are cached indefinitely in assets/cache/tweetthis.txt).
Simply paste code into a new snippet called "TweetThis". Call it li...
3
813
posted 15 years ago by DaveChild
Grab 5 latest Wordpress posts and display them on a non-Wordpress PHP page.
1
705
posted 15 years ago by kwilson
Put this before the loop in archive.php to have posts in the archive for category '26' sorted by custom field 'date'.
Assign sortable values like '090501' or '2009-05-01' to those fields when editing posts and your Upcoming Events will be sorted by...
8
1893
posted 15 years ago by hussong
A fallback for php's json_encode functionality. What do you think?
1
684
posted 15 years ago by kirie
Skor PHP Template class can assign individual variable values or arrays with several variable values. A separate sub-class extends the base class to support delimited template section replacements.
0
694
posted 15 years ago by Agundur
You can get hostname from script environment - getenv("HTTP_HOST")
(?!'.$host.') matches URLs always except local links
0
781
posted 15 years ago by kossmoss
In phpMyAdmin you can define strftime formats for your dumped database sql files. Here you are with two formats, one for sigle table export, one for multi-table export.
0
846
posted 15 years ago by dawjdh
Simple way to escape string for LIKE statements, useful for searches.
3
739
posted 15 years ago by robv
To convert links on a twitter status to a clickable url. Also convert @ to follow link, and # to search
3
1197
posted 15 years ago by mardix