How do i put a dropdown list of ALL my post in the sidebar menu?

<?php // query for all posts $your_query = new WP_Query( ‘posts_per_page=-1’ ); echo ‘<select>’. ‘<option value=”” selected=”selected”>Select a post</option>’; // loop through posts while ( $your_query->have_posts() ) : $your_query->the_post(); echo ‘<option value=”‘; the_permalink(); echo ‘”>’; the_title(); echo ‘</option>’; endwhile; echo ‘</select>’; // reset post data wp_reset_postdata(); ?> Obviously, that does nothing unless you bind some … Read more

jquery: getting contents of #content field on post page

The div #editorcontainer contains a regular textarea #content and an iframe #content_ifr. The #content is filled with the saved contents of the post when the page loads. This means that any live edits of the content won’t be returned when calling jQuery(“#content”).html(). For the same reason, you get an empty string in the case of … Read more

custom data in url

You can use the details here in this answer to solve your problem : Pretty URL with add_query_var Something along the lines of add_rewrite_endpoint(‘item’, array(EP_PAGES)); resulting in a rewrite rule that would let you use /prof/vac/item/1234 which you would then check in the vac pages template for a query variable ‘item’ and pull its value … Read more

Error on Include php:/usr/share/pear

Would it not make more sense to use get_template_part() ? What may be happening is that there is no 404 template: if ( ” != get_query_template( ‘404’ ) ) include( get_query_template( ‘404’ ) ); http://codex.wordpress.org/Function_Reference/get_query_template This may be because pretty permalinks have been turned off, or because there is no 404 page template to be … Read more

wp_list_pages Format only on Recently Modified Pages

By default the function cannot do this, but you can specify a custom walker when you call the function, and then implement your own walker: http://bugssite.org/blog/2009/12/08/wordpress-custom-walker-tutorial/ http://www.wprecipes.com/how-to-modify-lists-like-categories-and-blogroll-in-wordpress This way you can keep the code the same, but add a check on the date of the page being walked over, and ‘skip’ it if it doesn’t … Read more

Exclude admin from the top commenters list [duplicate]

Assuming the comment_author is a User ID, try: if(user_can($result->comment_author,’manage_options’)){ $output .= “<li>”.(($result->comment_author_url) ? “<a href=””.$result->comment_author_url.””>” : “”).$result->comment_author.(($result->comment_author_url) ? “</a>” : “”).” (“.$result->comments_count.”)</li>”; } If not, one can use get_comment, and select the comment_ID in the SQL statement. You can then use the object returned to grab the user ID of the comments author, and do … Read more

Custom post type permalink structure

function myrules(){ add_rewrite_rule(‘^yourcptslughere/([^/]*)/([^/]*)/([^/]*)/?’,’index.php?p=$matches[1]&taxonomy=$matches[2]&name=$matches[3]’,’top’); } add_action(‘init’,’myrules’); Replace the ‘yourcptslughere‘ with what you wanted, and then add that to functions.php then flush your rewrite rules, and the final example you posted should work. I doubt it will be what the_permalink() returns however so you will have to construct the urls yourself, however they should be viewable at … Read more