Insert the current theme header into an external HTML/XHTML file

The key to answer was found on SO; here is the solution for my case: create a PHP file with the following: <?php define(‘WP_USE_THEMES’, false); require(‘path/to/your-wordpress-dir/wp-blog-header.php’); get_header(); ?> //Contents of the body of your XHTML page go here <?php get_footer(); ?> Now you have an external page in the format of your WordPress theme.

Child theme breaks after update of master theme

The only string to use the master is Template: twentyten in the style.css if child theme. Check, if this string correct or has the master change this. If you activate the master as Theme in your install, you find the string also in the database of the WP install, in table options, entry template and … Read more

one page wordpress theme

I understand now! You just need to figure a way to programmatically generate sections of code with anchors and have your main menu link to those anchors! <?php $args = array( ‘post_type’ => array( ‘page’ ), ‘post_status’ => array( ‘publish’ ), ‘orderby’ => ‘menu_order’, ‘order’ => ‘asc’ ); query_posts( $args ); if (have_posts()) : while … Read more

List of categories instead of dropdown menu selector in admin options

In that case you can get the list of categories and for each category create a text field something like this: $categories = get_categories(‘hide_empty=0&orderby=name’); foreach ($categories as $cat){ $options[] = array( “name” => $cat->name, “desc” => “Select a color for “.$cat->name.” category”, “id” => $shortname.”_cat_”.$cat->term_id, “type” => “text”, “std” => “”); }

Twenty Ten theme – how to put a different header banner on every page

find and delete the custom header images under dashboard -> media -> library that is referring to header.php in the folder /wp-content/themes/twentyten/ don’t edit wp-blog-header.php (this is a core file which should never be edited) nor header.php of your theme; simply set a ‘featured image’ for each page where you want a different header image; … Read more

Blackberry mobile theme redirection

I’ve been using Chris Schuld’s Browser Class with very good results detecting a variety of data from the browser agent. Example of use require_once(‘lib/Browser.php’); $browser_check = new Browser(); $browser = $browser_check->getBrowser(); function browser_check($what) { global $browser; switch ($what) { case ‘ie’: if ($browser==Browser::BROWSER_IE) return true; else return false; break; case ‘bb’: if ($browser==Browser::BROWSER_BLACKBERRY) return true; … Read more

Date based CSS/theme

I php you can create an anchor class based on the desired date. I haven’t tested it, but it should be something like this: // your relevant html parent element <div class=”<?php echo getOlderPostsClassName( ‘5/5/2012’,the_time() ); ?>”> function getOlderPostsClassName($untilDate, $wordpressPostDate) { $start = strtotime($untilDate); $end = strtotime($wordpressPostDate); if ($start-$end > 0) { return ‘My_css_class_for_older_posts’; } … Read more

Cannot update a file for my theme

Those widgets are added because you’ve specified none Try adding a text widget with no content but spaces, you’ll find all those hardcoded default ‘widgets’ dissappear You should never use the built in editor in WordPress though, so use FTP/Shell/VCS instead

get_pages Not accepting my query

I have pulled up stumps on this approach and gone back to my original function. It goes through the posts, looks for the Partner Level passed to it, and then retrieves a list of pages. I then display a styled list with the posts thumbnail as the clickable link. Will need to tweak for reach … Read more