Profile
Achievement
crypticsoft's Recent PHP Snippets
- All /
« Prev 1 Next »
This shortcode was tested with The Events Calendar version 3.3.1
Usage: [upcoming_events limit="6"]
0
1626
posted 12 years ago by crypticsoft
While the Pinnacle Cart API can handle some of this, I found it easier to query the database directly.
This PCProduct class was developed for integrating Pinnacle Cart with WordPress with the following methods:
- get_product($id)
- get_product_by...
1
1796
posted 12 years ago by crypticsoft
This is a useful class which utilizes Phil Sturgeon's helpful restclient (http://getsparks.org/packages/restclient/versions/HEAD/show). Reference the URL attached for PinnacleCart API docs.
Example request URLs to get products and categories:
#...
0
1767
posted 13 years ago by crypticsoft
I need this function all too often and figured I'd share it. Limit the_content() by word limit by using built in WordPress functions.
0
2813
posted 13 years ago by crypticsoft
Here is a quick example on how to generate your own portfolio with filtering based on a taxonomy (in this case 'Solutions').
0
1781
posted 13 years ago by crypticsoft
Note: This also uses a flat file to cache the results, be sure to also upload the 'rss_cache.txt' file.
Usage:
<?php>
0
1686
posted 13 years ago by crypticsoft
For when you really just need a short description field along with a title for your slideshows. Just drop this into the functions.php and meteor-slideshow.php in the theme folder.
0
2180
posted 13 years ago by crypticsoft
For those cases where you want to code in PHP but need to deploy to ASP. It doesn't account for php logic but only converts the php include() statements into SSI includes. Could be useful for converting basic websites from php to asp, rare but it hap...
0
2831
posted 13 years ago by crypticsoft
Sometimes you just want a random link to display and outside of the default format, this works perfectly and removes all default html (list items / headings).
0
2689
posted 13 years ago by crypticsoft
When you create a custom post type and need to query by ID then you can pass in the 'field' and the 'terms' with the ID for that post type.
0
1761
posted 14 years ago by crypticsoft
The code references a custom post type (mysite_listings) and adds custom columns for editing the listings in the admin. This adds custom fields onto the edit / list views.
Note: You will want to change instances of "mysite_listings" with your own...
1
2200
posted 15 years ago by crypticsoft
Example shows how to register post types for :
* Listings (defined as 'mysite_listings' with the rewrite slug 'lookup')
* Then registers the 'usa_states' taxonomy to the mysite_listings post type.
0
1979
posted 15 years ago by crypticsoft
returns "City, State" if found otherwise defaults to "Hollywood, CA"
18
13876
posted 15 years ago by crypticsoft