MichaelH
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Custom Permalink DRAMATICALLY slows websiteFrom Using Permalinks
For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text “page slug” as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to have at least two path segments in your post’s permalink structure such as /%year%/%post_name%/ or even /posts/%post_name/. (Some people recommend /%post_id%/%post_name%/ which works for performance reasons but others recommend against it because it is unfriendly to users in the many contexts in which users interact with URLs.) See Otto’s technical writeup on the topic as well as this wp-testers discussion.
Forum: Plugins
In reply to: i want login and register box pluginForum: Themes and Templates
In reply to: multiple blogs pages?Use two categories News and Stories then in your main page (e.g. index.php) exclude the Stories category, then use the Categories Widget to give access to Stories.
The article, The Loop, explains excluding a category.
Related:
Stepping Into Template Tags
Stepping Into Templates
Template Hierarchy
Category TemplatesForum: Themes and Templates
In reply to: 5 Loops Based On Category & TagsDon’t know that there would be a better way and doubt pagination would work.
Forum: Fixing WordPress
In reply to: How do i make a post summarize.Use either
<!--more-->in your post or use the template tag, the_excerpt().Excerpt
Customizing_the_Read_More
Stepping Into Template Tags
Stepping Into Templates
Template HierarchyForum: Fixing WordPress
In reply to: Too many posts showing….Try this plugin:
http://wordpress.org/extend/plugins/custom-post-limits/Forum: Fixing WordPress
In reply to: multiple custom post types not workingDon’t see a response here but your add_action refers to ‘create_post_types’ and the function is create_post_type so one of them needs fixing.
add_action('init','create_post_types'); function create_post_type() {Forum: Themes and Templates
In reply to: How do I show first 5 posts as summaries and the rest as titles?Here’s one example:
<?php $count = 0; $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(); ?> <?php $count++; if ($count <= 5) { the_content(); } else { the_title(); } endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>Related:
Customizing_the_Read_MoreForum: Plugins
In reply to: [Category Shortcode] [Plugin: Category Shortcode] Dates not displayingProbably because of this from the_date()
SPECIAL NOTE: When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use the Template Tag the_time() or get_the_date() (since 3.0) with a date-specific format string.
Use <?php the_time(get_option(‘date_format’)); ?> to add the date set in the admin interface.Forum: Fixing WordPress
In reply to: Linking Post to LinksPut
<!--more-->in your post content where you want that link to appear.Note: If using the Visual Editor use the Insert More Tag button
Forum: Fixing WordPress
In reply to: Adding published date just before post …With the help of the Template Hierarchy article, determine what Template is displaying your posts (could be your theme’s index.php).
Then look for the template tag, the_content().
If you are not currently displaying the whole post content then you may not find the_content.
If necessary use http://wingrep.com on a local copy of your theme to find the_content.
Forum: Hacks
In reply to: grabbing posts by meta the advanced wayPlease look closely at the example using
get_col.Forum: Fixing WordPress
In reply to: Adding published date just before post …So find where
the_content()is used and put something like<?php the_time('m.d.y') ?>Forum: Fixing WordPress
In reply to: Adding published date just before post …one example
<p><?php the_time('m.d.y') ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>Also see the_time() for more formatting choices
Forum: Plugins
In reply to: Run a query in a custom widget?<?php $id_of_post = 123; $args=array( 'p' => $id_of_post, 'post_type' => 'myptname', '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 endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>Adding order and orderby for retrieving just one post wouldn’t be necessary.