Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged wordpress
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This used to be code adapted from Z'Oc, but I decided to start again and write it fresh with WP_Query instead of get_posts.
3
600
posted 14 years ago by kristarella
Recently moved my Wordpress blog to a tumblr account while I was removing a hosting account, wrote this script to do the transfer for me using Wordpress' Export feature and Tumblr's API.
It's rough around the edges but gets the job done!
2
1096
posted 14 years ago by shakefon
This turns the about page into a featured category post page. The principles for just a regular custom page template with sidebars is there too.
3
1130
posted 14 years ago by kristarella
This provides a teaser, with content from a custom feild, or the excerpt if no field exists. Everything except the title and edit link need to be turned off in the options.
3
609
posted 14 years ago by kristarella
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
699
posted 14 years ago by nerdsane
Down & Dirty Wordpress code to show specific links only to admininstrators. Can be refined using WP roles and Capabilities for more specific needs.
3
584
posted 14 years ago by goddess
Grab 5 latest Wordpress posts and display them on a non-Wordpress PHP page.
1
519
posted 14 years ago by kwilson
Use [short] in a post to insert the text from the function.
2
584
posted 14 years ago by kristarella
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
1591
posted 14 years ago by hussong
This example is adding a feature box after the first post. You can apply it to any of the hooks inside the loop.
2
568
posted 14 years ago by kristarella
This example adds tags and categories to the Thesis byline, each on a new line, and with the needed classes to match the other byline items.
The byline is generated in thesis/lib/functions/content_functions.php (v1.4.2 at the time of writing) look...
5
630
posted 15 years ago by kristarella
Load jQuery into WordPress generated pages, the wp_enqueue_script function can be used in plugins as well. OR Add and load a new script that depends on jQuery (this will also cause it to load jQuery into the page as well).
2
602
posted 15 years ago by selfmadepsyche