Posts tagged with: Source Code

How to show feedburner subscriber & Twitter follower counts

Code is PoetryWant to display your Feedburner RSS subscriber numbers on your blog? And maybe to show off your Twitter follower count as well? Look no further, you can find how to do that in this post.

I’ll show you the easy way (using buttons from a service). And I’ll show you a better way. It requires tweaking some PHP-code and your theme/template files, but if you’re used to edit your files already, this will be easy.

With the better, more advanced way, we’ll be getting the subscriber and follower counts as plain text, and then have all the control how to display the numbers any way we like and use CSS to make it all look nice.

Click to read

Other Tags: Feedburner, Hacks, How-To, php, Twitter, WordPress
Topic: Blogging

Posting Source Code on Your WordPress Blog Posts

Getting source code to display correctly in your blog can be a pain. I tried and tried to work with the <code> tags, but occasionally the visible code wasn’t ok (for example replacing quotes and doublequotes incorrectly), taking one “-” off from html comment etc. Jumping on and off from “Visual” and “HTML” editor and updating a post seems to do this.

But of course there’s a solution in the wonderful open source community and WordPress plugins that utilize the power. This isn’t exactly breaking news as these have been around for while, as I picked up this post:

I checked if this would’ve worked by default on self-hosted WordPress, but it seemed like it wouldn’t, so I went to plugin hunt. And there seemed to be aplenty of plugins for source code publishing, some with syntax highlighting, some just making sure code displays correctly in <code> tag.

But this is what I decided to try for now and it seems to work nicely:

So whether you want to display just some html code or more advanced source code, these kind of plugins are for you. They are good for both one-two liners as they are for hundreds of lines of serious code. There’s plenty of tags in use and all you have to do is enclose the code in a tag and define a language if you want. And the plugin supports a “lighter” style with no highlighting, but securing the formatting the same way.

Since writing this post I have removed the plugin, as I only post sourcecode to posts so often, and the plugin is on with the default so it puts the javascript code to every page, unless you set if off on the post window. However, if you’re blog is about coding and you post sourcecode, like html, php, c, or whatever almost every post, this plugin works great (at least until WordPress version 2.7).

Thanks for all these great blogs and bloggers for helping me by providing a bunch of information on the subject:

So if you like to read more about source code in posts, check the above for detailed info.

Other Tags: Plugins, WordPress
Topic: WordPress Plugins