Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Breadcrumbs for Taxonomy for a Custom Post type

This is what I came up with to display the category, or rather a custom taxonomy, of a single posttype page of use in a breadcrumb. The taxonomy I used is ‘smg-logo-brand’ and the terms slug where ‘kcrg’, ‘the-gazette’ and ‘sourcemedia.’ I compared the terms associated with the post to that in the URL to […]

WP-o-Matic breaks WordPress Related Links

function adminInit() { auth_redirect(); // force display of a certain section $this->section = ($this->setup) ? ((isset($_REQUEST[‘s’]) && $_REQUEST[‘s’]) ? $_REQUEST[‘s’] : $this->sections[0]) : ‘setup’; // if (isset($_SERVER[‘HTTP_USER_AGENT’]) && (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘MSIE’) !== false)) // die(‘Please switch to Firefox / Safari’); wp_enqueue_script(‘prototype’); wp_enqueue_script(‘wpoadmin’, $this->tplpath . ‘/admin.js’, array(‘prototype’), $this->version); if ($this->section == ‘list’) wp_enqueue_script(‘listman’); //if ( WPOTools::isAjax() ) […]

SlidePress Plugin Redirect Bug

When clicking on settings links for the SlidePress plugin in a multi-user WordPress site the plugin would redirect to /wp-admin/?c=1 for each domain except the parent site.

[code lang=”php”]function get_current_user_role() { global $current_user, $wp_roles; $role_names = $wp_roles -> get_names(); /* UPDATED 11/2/2010 9:21 AM * by matt.thiessen@sourcemedia.net */ // modified [start] reset($current_user->roles); $first_key = key($current_user->roles); […]

is_home() not working in my WordPress plugin

When using is_home(), is_category(), is_page() etc. in my WordPress plugin that displays category-based ads, they kept returning NULL.

My problem was that I was calling this these function directly in my plugin. I resolved this by adding these call to my adHeaderSetup() function and setting the hook add_action(‘wp_head’, ‘adHeaderSetup’);

USPS Web Tools

I was trying to add the USPS API into osCommerce. I received the following error when adding this shipping module:

RateV3 is not a valid API name for this protocol

This is because when you create an account for the Web Tools at USPS you only have access to their test server. The USPS test […]

Displaying Child Page Links in A Template

[…]

php turns SQL to Excel

Thanks StarGeek for this code.

this php script will write data from php using text from an SQL table (MySQL, supply your own SQL query) to a microsoft excel (.xls) file. The Excel file is specified as such by a set of headers, defining content, using php’s header() function.

<?php //Written by Dan Zarrella. […]