WordPress Codesnippets

The Easiest Way To Find WordPress Code Solutions

Latest snippets

adding zip file

This code opens a zip file called ‘test.zip’ and adds a file called ‘test.txt’ to it. It then closes the

Read more

add widget zone

‘ => ‘</section>’, ‘before_title’ => ‘<h2 class=”widget-title”>’, ‘after_title’ => ‘</h2>’, ) ); } This code is used to create a

Read more

add zip

This wordpress code is adding a filter that will make the billing postcode field required on the checkout page.

Read more

add xml sitemap

gt;0.8</priority> </url> <url> <loc>http://example.com/catalog?item=12&amp;desc=vacation_hawaii</loc> <changefreq>weekly</changefreq> </url> <url> <loc>http://example.com/catalog?item=73&amp;desc=vacation_new_zealand</loc> <lastmod>2004-12-23</lastmod> <changefreq>weekly</changefreq> </url> <url> <loc>http://example.

Read more

add x-default

This wordpress code specifies an alternate version of the page for visitors using a different language. The “x-default” value indicates

Read more

add xml wordpress

gt;Mon, 13 Jul 2015 12:00:00 +0000 </lastBuildDate> <language>en-US</language> This code defines an XML document for a WordPress site. The document

Read more

add to sitemap.xml

the sitemap as an XML file $fp = fopen(ABSPATH . ‘sitemap.xml’, ‘w’); fwrite($fp, $sitemap->asXML()); fclose($fp); ?> This code creates a

Read more

add x-frame-options

The code above will add the “X-Frame-Options: SAMEORIGIN” header to all HTTP responses sent from WordPress. This header tells browsers

Read more

add widget area

The code is for a WordPress plugin or theme. It checks to see if the “register_sidebar” function exists, and if

Read more