Own code on index.php wordpress theme file, help with the rewrite rules

Your rewrite rules must not start with the first slash, that is already stripped out. So the following code will add a rewrite rule that will set a query variable that we can later use: add_action( ‘init’, ‘wpse9016_init’ ); function wpse9016_init() { add_rewrite_rule( ‘currentpage/(\d+)/?’, ‘index.php?wpse9016_currentpage=$matches[1]’, ‘top’ ); } This query variable is ignored unless we … Read more

How to create a custom loop ordered by Categories on a Page Template?

Not sure if this is exactly what you’re asking, but it sounds like you’re looking for nested loops. This will list the most recent 5 posts in every category on your site: foreach ( get_terms(‘category’) as $category ) { echo ‘<h2>’.$category->name.'</h2>’; echo ‘<ul>’; foreach ( get_posts( ‘cat=”.$category->term_id ) as $post ) { setup_postdata( $post ); … Read more

WordPress MailChimp Framework suddenly stopped working without modification [closed]

Well, it seems that the author of WordPress MailChimp Framework is on indefinite vacation. So I suggest to you having the same problem as this one is to go through the PHP MCAPI wrapper (http://apidocs.mailchimp.com/downloads/#php) since this one is directly supported by the MailChimp team. The team has updated the wrapper to handle dropped connections. … Read more

convertEntities() used before it is defined

The convertEntities function was defined in utils.js, but if you use script concatenation this file would be included after it is needed. Because it was in a try-catch clause, the error was not (always) noticed. The solution is to include the convertEntities function before this code is loaded. In WordPress 3.1 this is now included … Read more

Tags as autocomplete values

if(isset($_GET[‘get_tags’])): $output = array(); foreach(get_terms(‘post_tag’) as $key => $term): // filter by $_GET[‘q’] here if you need to, // for eg. if(strpos($term->name, $_GET[‘q’]) !== false)… $output[$key][‘value’] = $key; $output[$key][‘name’] = $term->name; endforeach; header(“Content-type: application/json”); echo json_encode($output); die(); endif; in this case your js would be something like: $(“#input_1_3”).autoSuggest( “http://yoursite.com/?get_tags=1”, {selectedItemProp: “name”, searchObjProps: “name”});