MichaelH
Forum Replies Created
-
Forum: Hacks
In reply to: Get posts that DOESN'T have meta-keys?Depends on where you want to ‘see’ that displayed. See Template Hierarchy.
Forum: Fixing WordPress
In reply to: Deleting categories and subcategoriesI’d consider creating a new category, then changing the default post category to that new category.
Forum: Themes and Templates
In reply to: how to select pages with specific page template?<?php $meta_key = '_wp_page_template'; $template = $wpdb->get_var( $wpdb->prepare("SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post->ID) ); $template_pages = $wpdb->get_col( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %s", $meta_key, $template) ); wp_list_pages('include=' .implode(",", $template_pages)); ?>Forum: Fixing WordPress
In reply to: Show only latest single post for multiple categories on Home PageOne example:
<?php //get terms (category ids 11,2,33,34), then display one post in each term $taxonomy = 'category';// e.g. post_tag, category $param_type = 'category__in'; // e.g. tag__in, category__in $term_args=array( 'include' => '11,2,33,34', 'orderby' => 'name', 'order' => 'ASC' ); $terms = get_terms($taxonomy,$term_args); if ($terms) { foreach( $terms as $term ) { $args=array( "$param_type" => array($term->term_id), 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo 'Latest Post in '.$taxonomy .' '.$term->name; while ($my_query->have_posts()) : $my_query->the_post(); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php endwhile; } } } wp_reset_query(); // Restore global post data stomped by the_post(). ?>Forum: Fixing WordPress
In reply to: Deleting categories and subcategoriesWhen you delete a catgory the posts get assigned to the ‘Default Post Category’ defined via Administration > Settings > Writing.
As for the bulk category question–there is this
http://robm.me.uk/projects/plugins/wordpress/batch-categories
http://uwmike.com/wordpress/wp-cats/
http://wordpress.org/extend/plugins/bulk-move/You can also use the standard Bulk Edit with this caveat:
“Categories and Tags can be ADDED in bulk to a set of Posts, but it is not possible to CHANGE, or DELETE, a Category, or Tag, for those Posts.”Forum: Everything else WordPress
In reply to: How do I eliminate a topic in the forum?I didn’t find that doing a google search so maybe it is cached by Yahoo, but that topic NO LONGER EXISTS so not sure you can do anything but contact Yahoo about that.
Here’s the link if you don’t believe it:
http://wordpress.org/support/topic/please-helpsite-is-not-found-when-search-for-using-google#post-1759369Forum: Hacks
In reply to: Get posts that DOESN'T have meta-keys?Didn’t test this but, this queries all posts, and then loops through each post and if the custom field doesn’t exist display the post title:
<?php $args=array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); $custom = get_post_meta($my_query->post->ID, 'yourcustomfield', true); if ( ! $custom ){ ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php } endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>Forum: Fixing WordPress
In reply to: Links from categoryTry
$cat_id = get_cat_ID('whateveryourcategory'); wp_list_bookmarks('category='.$cat_id);Forum: Everything else WordPress
In reply to: How do I eliminate a topic in the forum?If it is a link to a forum post, then post the link to that forum post.
For example the comment you just made on this thread has the link:
http://wordpress.org/support/topic/how-do-i-elimate-a-topic-in-the-forum?replies=8#post-1767645The link is under the # next to the Post xx minutes ago
Forum: Hacks
In reply to: Get posts that DOESN'T have meta-keys?Not sure what you mean by ‘set’, but what about:
$args=array( 'meta_key' => 'your_custom_field', 'meta_value' => 'your_custom_value', 'meta_compare' => '!=", 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args);Note: wonder what happened to my first response to this thread?
Forum: Everything else WordPress
In reply to: How do I eliminate a topic in the forum?Jenette – please provide a search link or the actual url to see that forum topic, as there just THIS topic listed under your profile.
Forum: Fixing WordPress
In reply to: get the author posts url link of Author Archive Page in WordPress<?php //echo "<pre>"; print_r($wp_query->query_vars); echo "</pre>"; $author = get_query_var('author'); echo get_author_posts_url( $author ); ?>Forum: Fixing WordPress
In reply to: how can i specify the order of posts?Forum: Themes and Templates
In reply to: How to format 1st post different from the rest on index.php?The article, The Loop, has one example styling posts differently.
Also see: http://www.google.com/search?q=wordpress+style+first+post+differently
Forum: Fixing WordPress
In reply to: How to change "VENDORNAME"Could be in your theme’s footer.php.
If you continue this thread, please provide a link to download the theme.