Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged wordpress
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
To arrange multiple dynamic sidebars in wordpress, add the following code snippet into functions.php. The sidebar should then appear in the dropdown menu in wordpress under the widgets section. Next, go into your sidebar.php file & edit the dynamic s...
2
719
posted 15 years ago by kstetson
Enable the use of Custom Fields in Wordpress. This is the code to put into the markup. Related plugin: get-custom-field-values
0
837
posted 15 years ago by taqin
This example will display the full content of the five most recent posts, and just the headlines from the five before that.
1
1817
posted 15 years ago by kwilson
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
772
posted 15 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
1352
posted 15 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
1387
posted 15 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
826
posted 15 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
904
posted 15 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
761
posted 15 years ago by goddess
Grab 5 latest Wordpress posts and display them on a non-Wordpress PHP page.
1
705
posted 15 years ago by kwilson
Use [short] in a post to insert the text from the function.
2
772
posted 15 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
1895
posted 15 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
743
posted 15 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
843
posted 15 years ago by kristarella