How to create a second index.php?

Elaborating on Rachel Baker’s answer: Copy the index.php file and name it something like popular.php. At the very top, paste the following: <?php /* Template Name: Posts by Popular */ ?> Now, go in to the WordPress admin and create a new page, called something like “By Popular”. On the right-hand side, select the “Posts … Read more

Can’t get default values to work with custom shortcode

extract takes and associative array and explodes it out in variables that reflect the array key names. $atts[‘height’] would just be $height, in other words. The relevant two lines of your code would become: <param name=”type” value=”video/quicktime” height=”‘.$height.'” width=”‘.$width.'”> <embed src=”‘.$url.'” height=”‘.$height.'” width=”‘.$width.'” autoplay=”false” type=”video/quicktime” pluginspage=”http://www.apple.com/quicktime/download/”> If you did still want to use the indexing, … Read more

Apply Classes to post text inside editor

You’ll need two code snippets. The first puts the select menu there. The second populates it. This is based on this tutorial, but slimmed down a bit. add_filter( ‘mce_buttons_2’, ‘mrw_mce_bad_buttons’ ); add_filter( ‘tiny_mce_before_init’, ‘mrw_mce_init’ ); function my_mce_buttons() { return array(‘formatselect’, ‘styleselect’, ‘|’, ‘forecolor’, ‘underline’, ‘justifyfull’, ‘|’, ‘pastetext’, ‘pasteword’, ‘removeformat’, ‘|’, ‘charmap’, ‘|’, ‘outdent’, ‘indent’, ‘|’, … Read more

how to get extra info from checkout in wp-ecommerce

Managed to figure it out. The pdf output code has this to get the normal field values: $form_sql = “SELECT * FROM `”.$wpdb->prefix.”wpsc_submited_form_data` LEFT JOIN `”.$wpdb->prefix.”wpsc_checkout_forms` ON “.$wpdb->prefix.”wpsc_submited_form_data.form_id = “.$wpdb->prefix.”wpsc_checkout_forms.id WHERE `log_id` = ‘”.(int)$purchase_id.”‘ AND `active` = ‘1’”; $input_data = $wpdb->get_results($form_sql,ARRAY_A); The there is a switch statement based ont he unique_name but as this is … Read more

Creating a custom menu

Rob, take a look at using register_nav_menu function in WordPress it allows you to build custom menus with ease. http://codex.wordpress.org/Template_Tags/register_nav_menu

RSS Feed broken

I don’t know that this has anything to do with WordPress, but I’m pretty sure it should be UTF-8, not UTF-5. The first line of your RSS feed reads <?xml version=”1.0″ encoding=”UTF-5″?>. Edit: Try checking your Reading Settings for the Encoding for pages and feeds entry.

Preventing tinyMCE from auto formatting selected blocks of content

You can try adding this to your functions.php file: <?php function my_formatter($content) { $new_content=””; $pattern_full=”{(\[raw\].*?\[/raw\])}is”; $pattern_contents=”{\[raw\](.*?)\[/raw\]}is”; $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($pieces as $piece) { if (preg_match($pattern_contents, $piece, $matches)) { $new_content .= $matches[1]; } else { $new_content .= wptexturize(wpautop($piece)); } } return $new_content; } remove_filter(‘the_content’, ‘wpautop’); remove_filter(‘the_content’, ‘wptexturize’); add_filter(‘the_content’, ‘my_formatter’, 99); ?> Once … Read more