HOW TO RESTORE THE DIGG COUNT ON THE DIGG WIDGET AFTER CONVERTING TO OR FROM FANCY PERMALINKS AND PRETTY PERMALINKS IN WORDPRESS
When I migrated to fancy permalinks (the URL or website page address method) or what are also called pretty permalinks, I lost the Digg count on the Christian Commons Project™ post. The Diggs were still there on Digg.com under the original title that was submitted, but those Diggs were associated with the old standard post ID# (%post_id%). They weren't showing up on the post page anymore.
I had to convert to fancy/pretty permalinks to be able to use WP Super Cache. It was worth it. WP Super Cache though depends on pretty permalinks to build its cache. I used Dean's Permalinks Migration Plugin to get the job done and not lose all the in-coming links to the old URLs that were based on the post ID numbers.
You can read about that on my post: .HTACCESS, ASIRRA, PERMALINKS, GODADDY, PERMALINKS MIGRATION, THEME SWITCHER, WORDPRESS, WP SUPER CACHE, AND WP-CACHE
Posted:
Thursday, September 18, 2008
@ 9:46:35 PM (Pacific Time)
By Tom Usher
That though didn't do anything for the Digg Widget on the Christian Commons Project post.
Unfortunately, Digg's widget that you place on your site reads the current permalink structure and has no way of being backward compatible with the old permalinks. I needed to work around this.
I wanted the few Diggs back on the Christian Commons Project post. I went out searching for solutions. I ended up creating a template for a new category in which the only post I placed is the Christian Commons Project post.
The Christian Commons Project post is also categorized under other categories, but no other posts are also categorized with it in the new category.
I placed a manually scripted Digg widget in that new template file which widget points to the old, original permalink that is based on ?p=1030, the post ID for the Christian Commons Project post. Now the post shows the few Diggs for the post again.
<!-- Start "Digg This" -->
<script type="text/javascript">
digg_url = 'http://www.realliberalchristianchurch.o rg/wordpress/?p=1030';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
<!-- /"Digg This" -->
You see "?p=1030" in the script above. Digg's widget ordinarily automatically grabs and uses the full, current URL that on this site is now a fancy or pretty permalink. "?p=1030" is now "2007/01/01/the-christian-commons-projec t-of-the-real-liberal-christian-church.h tml" The full path is "http://www.realliberalchristianchurch.o rg/wordpress/2007/01/01/the-christian-co mmons-project-of-the-real-liberal-christ ian-church.html"
nathanrice.net got me started making a special template just for the Christian Commons Project post. It was helpful but wasn't the ultimate solution though. Read it, but also read on here.
The original category for the Christian Commons Project is ID 157. If I were to have created a "single post" template for that category, all of the posts in that category would automatically have shown up using that template. I didn't want each of those posts showing the manually altered Christian Commons Project post Digg Widget, although I could have done that since the Christian Commons Project post is the focus really. It would have been confusing for people though who would be rightly expecting that any Diggs would be about the immediate post and not the Project's main post.
Therefore, I created a new category entitled, "Christian Commons Project Single Post." Its ID is 18977.
nathanrice.net helped to explain one method for having the new, single template for this category called up any time anyone selected to visit the Christian Commons Project post.
Don't rush to use the following function though, because it locked me out of my WordPress administration until I deleted it.
<?php
add_filter('single_template', create_function('$t', 'foreach( (array) get_the_category() as $cat ) { if ( file_exists(TEMPLATEPATH . "/single-{$cat->term_id}.php") ) return TEMPLATEPATH . "/single-{$cat->term_id}.php"; } return $t;' ));
?>
It worked, but it locked me out of the WordPress admin. I deleted the function and got back in fine. Then I installed this plugin instead.
I renamed the template file from "single-18977.php" (no quotation marks of course) to "single-cat-18977.php." It works just fine. I checked, and the plugin didn't write any new functions that could lock me out of admin.
If you read the pages linked to above and the plugin page, you'll understand that you need only copy ("save as") and edit your existing single.php template file to get this done. The only thing I changed on that page was the Digg Widget, although one could go much further with changes than that of course.
If you liked this post, if it helped you in any small way, please consider Digging the Christian Commons Project post
and/or contributing to the cause. If you're an Entrecard user, you can give EC (Entrecard credits) to this site. Visit here, and look for the link line, "Give credits to this site" in the right column.
Mind you, I didn't post this for the sake of selfish recompense. The Christian Commons Project isn't about selfishness. It's about the exact opposite. Considering all the damage all the greed in the world has been and still is doing, I'm sure you can appreciate that helping to promote unselfishness certainly is a good thing. Please help in any way you are able. Thank you.
Why bother with getting back the Diggs? Well as of the date of this post, Digg showed the following for the Christian Commons Project post:
Friended Diggers who Dugg the post:
paiute8
dcmusicfusion
ladybroadoak
TheodoreRichie
CarolVaughan
Who Blogged This?
3 people posted this story on their own blogs.
ladybroadoak: See the Post
TheodoreRichie: See the Post
CarolVaughan: See the Post
New Friend:
Lothar76
- Technorati Tags: Christian commons, communism, technology, Tom Usher, Digg count, Digg widget, fancy permalinks, pretty permalinks, WordPress, Christian Commons Project, Diggs, Digg.com, WP Super Cache, Plugin, template, category, javascript, Digg This, nathanrice.net, WordPress administration, single.php, Entrecard, EC, selfish, recompense, selfishness, greed, unselfishness, paiute8, dcmusicfusion, ladybroadoak, TheodoreRichie, CarolVaughan, Lothar76






Monday, October 6, 2008 @ 11:53:03 PM (Pacific Time)
If you feel overwhelmed, check in with your priorities here's only one of you, and stretching yourself too thin can lead to burnout. Kennedy Christian
Tuesday, October 7, 2008 @ 9:12:23 PM (Pacific Time)
@Kennedy Christian - That's a quote from Tutor.com | 5 Time Management Tips For Students.
I'm not saying you're wrong to have quoted it here, but I would appreciate it if you would elaborate on what you see as the relevance or connection.
Also, the site is copyrighted, and shouldn't you have indicated the source? I doubt if they'd mind either way, but I do try to promote giving credit where due.
Thank you for stopping by and commenting. I look forward to your reply.
Blessings,
Tom Usher