mrtoner
Forum Replies Created
-
So sorry, I read the “Paid Customers Read This” pinned post and then proceeded to be one of those people. :facepalm:
Forum: Fixing WordPress
In reply to: Image Slider WantedThanks, folks. Neither one — as you note — is quite what I want. Although I described it well, the actual term for the feature is “carousel.” This plugin is probably just what I need. I’m playing with the underlying jCarousel jQuery plugin and I’m very impressed.
Forum: Plugins
In reply to: [RSS Image Widget] [Plugin: RSS Image Widget] Can't get widget to work@bestodyssey: Your images aren’t in enclosures; instead, they’re part of the description.
Forum: Hacks
In reply to: 404 When Editing PostsBased on an example here I was able to solve the problem:
add_filter('post_link','df_fix_permalink'); function df_fix_permalink ($permalink) { if (get_the_linked_list_link() == '') { return $permalink; } return get_the_linked_list_link(); }Forum: Plugins
In reply to: post_link filter not affecting previous_post_link()I’d like to see the code you’re working on, since I don’t want the previous_post_link() and next_post_link() values to be affected. I’m also having an issue where my Edit Post link is being 404d when I use the post_link filter.
Forum: Themes and Templates
In reply to: Insert post within anotherThanks, Michael, it wasn’t so hard after all:
<?php if (in_category(array('resources','news'))) : $postslist = get_posts('category_name=recommends&numberposts=1&order=DESC&orderby=date'); foreach ($postslist as $post) : setup_postdata($post); ?> <div> <br /><br /> <h4>Not free, but worth it...</h4> <?php the_excerpt(); ?> <a href="<?php the_permalink(); ?>">Read more ยป</a> </div> <?php endforeach; ?> <?php endif; ?>Forum: Plugins
In reply to: Business DirectoryWas Googling when I came across your post. I found this:
http://wordpress.org/extend/plugins/business-directory/
but you didn’t mention what you’d already found. Perhaps what you found would be helpful to me?
Forum: Plugins
In reply to: Looking for a directory pluginWas Googling when I came across your post. I found this:
http://wordpress.org/extend/plugins/business-directory/
but you didn’t mention what you’d already found. Perhaps what you found would be helpful to me?
Forum: Fixing WordPress
In reply to: Passing Values to Pages3. ๐ I can’t get a rewrite to work at all for mydomain.com/lists/failure?code=F09. The only variable that I see to be able to use is %{THE_REQUEST}, but
RewriteCond %{THE_REQUEST} GET%20/lists/failure%3fcode=F09%20HTTP/1.1
RewriteRule . /?page_id=11&code=F09 [R]doesn’t work.
Forum: Fixing WordPress
In reply to: Passing Values to PagesI finally figured out #1:
RewriteCond %{QUERY_STRING} page_id=11?code=(F[0-9][0-9])
RewriteRule . /?page_id=11&code=%1 [R]but why is it that #2 doesn’t work?
Forum: Fixing WordPress
In reply to: Passing Values to PagesUsing $_SERVER[‘QUERY_STRING’] gives me the same results, blank for mydomain.com/lists/failure?code=F09.
Two additional options I thought I’d try:
1. Use mod_rewrite to change mydomain.com/?page_id=11?Fnn to mydomain.com/?page_id=11&Fnn, but try as I might I can’t get the rule correct.
2. Use explode() to parse the $_SERVER[‘QUERY_STRING’], but here’s a weird one:
<?php echo ($_SERVER['QUERY_STRING']); ?>returns page_id=11?Fnn, but
<?php $p =($_SERVER['QUERY_STRING']); ?>
<?php echo $p; ?>returns blank. I’m sure I’m just overlooking something simple in both cases.
Forum: Installing WordPress
In reply to: Can’t Completely Disable CommentsOkay, I’ve managed to track this down myself. I found where comments_popup_link () is located: it’s (appropriately) in comment-functions.php. In my mind the script has a few bugs and I have changed it as described below:
function comments_popup_link($zero='0 Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {Here the function has defined some defaults, just in case your template left them out.
global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb;
global $comment_count_cache;
if (! is_single() && ! is_page()) {
if ( !isset($comment_count_cache[$id]) )
$comment_count_cache[$id] = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1';");
$number = $comment_count_cache[$id];
if (0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status) {
echo $none;
return;Here WP checks to see if 1) there are no comments at this time, 2) “Allow Comments” is not checked, and 3) “Allow Pings” is not checked. If all three are true, WP echoes “Comments Off” — without a link — and returns. The problem here is that
echo $none;was not in the original code, so with comments off nothing would appear. I think it’s a good idea to let users know what the comment status is if they’re used to seeing comment links.} else {
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
echo('Enter your password to view comments');
return;
}
}
echo '<a href="';
if ($wpcommentsjavascript) {
if ( empty($wpcommentspopupfile) )
$home = get_settings('home');
else
$home = get_settings('siteurl');
echo $home . '/' . $wpcommentspopupfile.'?comments_popup='.$id;
echo '" onclick="wpopen(this.href); return false"';
} else { // if comments_popup_script() is not in the template, display simple comment link
if ( 0 == $number )
echo get_permalink() . '#respond';
else
comments_link();
echo '"';
}
if (!empty($CSSclass)) {
echo ' class="'.$CSSclass.'"';
}
echo ' title="' . sprintf( __('Comment on %s'), $post->post_title ) .'">';
comments_number($zero, $one, $more, $none, $number);Here’s where WP jumps to another function in comment-functions.php to insert the number of comments. I changed this line to add the
$noneparameter.echo '</a>';
}
}
}It was also necessary to fix comments_number ():
function comments_number( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $none = 'Comments Off', $number = '' ) {I changed this line so the function would accept the
$noneparameter.global $id, $comment;
$number = get_comments_number( $id );
if ($number == 0) {
if ( comments_open() ) {
$blah = $zero;
} else {
$blah = $none;
}Here I added the
elsebranch. Because it was missing, if the number of comments was zero the link would always read “0 Comments.” With this fix, if you have zero comments and commenting is off, you’ll see “Comments Off” (or whatever your template passes to comments_popup_link () ). If commenting is on and you have zero comments, you’ll still see “0 Comments.”} elseif ($number == 1) {
$blah = $one;
} elseif ($number > 1) {
$blah = str_replace('%', $number, $more);
}
echo apply_filters('comments_number', $blah);
}Of course, if you allow comments to begin with, add a few comments, and then disable comments, your comment links will still show the number of comments added before commenting was disabled.
This should make your comment links display more accurately.
Forum: Installing WordPress
In reply to: Can’t Completely Disable Comments@jwilliams: Yes, commenting out/deleting that line will drop off the comments, but the “0 Comments” text still remains. I don’t want to delete that text as well, since for some posts I want to enable comments, so I need to figure out why comments_popup_link() is returning the text for ‘zero’ when it should be returning the text for ‘none.’ (Where is this routine?)
@podz: No, not all commenting.
My mistake earlier: comments.php is working properly. The Comments RSS and Trackback links are the only items shown on the comments page, since they’re not explicitely excluded by
<?php if ( comments_open() ) : ?>. It’s only the link text that is incorrect.