MichaelH
Forum Replies Created
-
Forum: Plugins
In reply to: How to make my post appear in a static page.In your Page Template after the loop that displays that page content, add a loop to display that latest post…for example:
<?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(); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php the_content(); endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>Forum: Hacks
In reply to: grabbing posts by meta the advanced wayYou are saying “sorted by value” and “keeping the posts still sotrted by date”. Could you clear that up please.
Forum: Fixing WordPress
In reply to: SubsubcategoryThat’s the way WordPress is designed to work.
One possible plugin to help with that:
http://wordpress.org/extend/plugins/just-one-category/Forum: Fixing WordPress
In reply to: Posted Date is wrong, doesn't match published dateCheck the template that is displaying those posts (e.g. your theme’s index.php) and see how
the_time()is being used.Related:
Stepping Into Template Tags
Stepping Into Templates
Template HierarchyForum: Fixing WordPress
In reply to: Feature Post?Use a loop like:
<?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() ) { echo 'Featured Post'; 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: Posts per page?Use two query post loops.
See query_posts().
Or use plugins such as:
* http://wordpress.org/extend/plugins/postlists/
* http://wordpress.org/extend/plugins/list-category-posts/ (uses shortcode)
* http://wordpress.org/extend/plugins/simple-posts-list/ (uses shortcode}
* http://wordpress.org/extend/plugins/nurelm-get-posts/ (uses shortcode)
* http://wordpress.org/extend/plugins/sb-child-list/ (display pages either parent or child and has shortcode)and:
http://wordpress.org/extend/plugins/custom-post-limits/Forum: Fixing WordPress
In reply to: Error establishing a database connectionMaybe your host moved your database to another server. Call your hosting company to find out.
Maybe your database server is not operational. Call your hosting company to find out.
In your wp-config.php the database name and server and username and password are specified so check with your hosting company to make sure that information is correct.
Forum: Fixing WordPress
In reply to: Posts in multiple loops (First 2 and 3-10)Use offset
<?php $args=array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 2, '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(); ?> <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(). $args=array( 'offset' => 2, 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 8, '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(); ?> <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: child category empty and expiration dateSee the Iime Parameters in the query_posts() article.
Forum: Plugins
In reply to: Recent Posts Widget only allowing 15 posts to displayThat widget on allows 15 posts to display.
Alternatives:
* http://wordpress.org/extend/plugins/query-posts/
* http://wordpress.org/extend/plugins/wordpress-loop/
* http://wordpress.org/extend/plugins/category-posts/
* http://wordpress.org/extend/plugins/list-category/
* http://wordpress.org/extend/plugins/bns-featured-category/Forum: Fixing WordPress
In reply to: How to remove posts tags in bulkI’ll let you play with the formatting, but just to give you an idea here’s the loop.php I’m using:
Forum: Themes and Templates
In reply to: List by category and sub category & show category nameSomething like:
<?php //get all terms child of category 3, then display all posts in each term $taxonomy = 'category';// e.g. post_tag, category $param_type = 'category__in'; // e.g. tag__in, category__in $term_args=array( 'orderby' => 'name', 'order' => 'ASC', 'child_of' => 3 ); $terms = get_terms($taxonomy,$term_args); if ($terms) { foreach( $terms as $term ) { $args=array( "$param_type" => array($term->term_id), 'order' => 'ASC', 'orderby' => 'title', '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 'List of Posts 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: resetting user name and password at the same timeUse phpMyAdmin to look at your
wp_userstable to discern user names. Review Resetting Your Password to change a password.Forum: Fixing WordPress
In reply to: Back Date my Article PostI would recommend you read and perform WordPress Backups so that you can revert back.
Forum: Fixing WordPress
In reply to: How to remove posts tags in bulkDidn’t test this but you’d probably replace this code in loop.php of that theme with the code I listed:
<?php $tags_list = get_the_tag_list( '', ', ' ); if ( $tags_list ): ?> <span class="tag-links"> <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> </span> <span class="meta-sep">|</span> <?php endif; ?>