Welcome To Snipplr
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Issues a check to see if the "www" is included, if not, forces "www" to be appended to the URL in question.
        
        
        
            1 
        
        
            1401 
        
                    posted 13 years ago by thewickedchemist
            Save this as plugin.nextlink.php to your ndxz-studio/site/plugin folder. Call the Plugin where you need it: <plug:nextlink />
Original by "gd" http://www.indexhibit.org/forum/thread/7879/
        
        
        
            0 
        
        
            1152 
        
                    posted 13 years ago by G470
            dynamically selects a value in a select according to what's already in the DB
        
        
        
            0 
        
        
            1088 
        
                    posted 13 years ago by dato
            Use PHP to get JSON
1) set the PHP to the URL of the JSON
2) echo a variable with the loaded data
3) use a request via jQuery to get the variable from PHP
        
        
        
            0 
        
        
            1416 
        
                    posted 13 years ago by inreflection7
            A simple PHP function for fetching tweets. Just provide your Twitter screen name and how many tweets you want and that is it. The function returns a simplified result set because you rarely need all the stuff that the Twitter API throws your way. If...
        
        
        
            1 
        
        
            1682 
        
                    posted 13 years ago by Sverri
            Adding custom fields to the quick edit panel in Wordpress is easy using built-in hooks. However, the hook to add fields seems to be called multiple times, adding duplicate fields to the quick edit panel. Adding this code to the top of the function be...
        
        
        
            0 
        
        
            1273 
        
                    posted 13 years ago by briteweb
            This will let you execute certain scripts on the home page and other scripts on the other pages of the site.
        
        
        
            0 
        
        
            1282 
        
                    posted 13 years ago by dburgess
            This will detect the Home Page of Joomla and perfom whatever code you tell it to
        
        
        
            0 
        
        
            1200 
        
                    posted 13 years ago by dburgess
            Code snippet to create custom post type FAQ and custom taxonomy Topics in WordPress v. 2.9.2+
        
        
        
            1 
        
        
            1315 
        
                    posted 13 years ago by mommygeekology
            If you’ve ever wanted to display your latest Twitter tweets on a website, here is method to do that using PHP.
        
        
        
            0 
        
        
            1564 
        
                    posted 13 years ago by i-am-andy
            This snippet shows a dynamic way to enable extra default include paths.
        
        
        
            0 
        
        
            873 
        
                    posted 13 years ago by tomcottrill
            When adding a meta box to a 'page' in Wordpress (as opposed to a post, or custom post type), you might want to disable the default editor.  Use this snippet in your theme's functions.php file to disable the editor for a specific page template.
        
        
        
            3 
        
        
            2291 
        
                    posted 13 years ago by f6design
            Set up a basic template:
<html>
<head>
<title>[[++site_name]] - [[*pagetitle]]</title>
<base>
<meta>​
</head>
<body>
[[*content]]
</body>
</html>
Content:
<div>
<h4>The ACME web site is currently under development</h4>
<p>Please...
        
        
        
            0 
        
        
            971 
        
                    posted 13 years ago by hotdiggity
            This is an example of omitting the width and height attributes from a thumbnail img tag in Wordpress. Useful if you are working on a responsive design. Use inside The Loop.
        
        
        
            0 
        
        
            1271 
        
                    posted 13 years ago by f6design
            Use WP_Query to query a custom taxonomy, using the tax_query parameter.
        
        
        
            1 
        
        
            1291 
        
                    posted 13 years ago by f6design
            In Wordpress if you are using a custom taxonomy you can get its details (id, slug, etc) using this snippet.
        
        
        
            0 
        
        
            1283 
        
                    posted 13 years ago by f6design
            Add this snippet to your Wordpress theme's functions.php file to reject any image uploads that are below the specified dimensions.
        
        
        
            2 
        
        
            1791 
        
                    posted 13 years ago by f6design
            Basically, a simple way to use a templating system in 
CodeIgniter. In your data array, add a view as the value for content. Pass that to the view, then print the $content variable in the view.
        
        
        
            0 
        
        
            1067 
        
                    posted 13 years ago by nielsenrc
            In this tutorial, we will see how to add custom fields to magento customer address.
        
        
        
            0 
        
        
            1132 
        
                    posted 13 years ago by etechblog
            This snippet adds support for post thumbnails (a.k.a. 'featured images') to a Wordpress theme. It also adds an additional image size for image thumbnails, hard cropped. This second step is optional.
Add this snippet to your WP theme's functions.ph...
        
        
        
            1 
        
        
            1519 
        
                    posted 13 years ago by f6design
            Add the following to your Wordpress theme's functions.php file. The jQuery paths/URLs might need to be changed to suite your circumstances.
        
        
        
            0 
        
        
            1841 
        
                    posted 13 years ago by f6design
            Simplify the Wordpress admin area for clients by hiding menu items. Add this snippet to your Wordpress theme's functions.php file.
        
        
        
            0 
        
        
            1485 
        
                    posted 13 years ago by f6design
            If you are creating a custom post type in Wordpress, and turn off the 'editor' capability, then TinyMCE is not loaded. This means any WYSIWYG meta box textareas will fail. Add this snippet to your theme's functions.php file to load the required TinyM...
        
        
        
            0 
        
        
            1246 
        
                    posted 13 years ago by f6design
            
