Finding RSS for tags, categories, etc. in WordPress

On the whole I like WordPress a lot, though there are sometimes some funky bits which make it a tad awkward.  Namely, if you’re looking to get an RSS feed link for a category, a tag, an author, or a search, you can do the following:

get_category_feed_link(get_queried_object_id());
get_tag_feed_link(get_queried_object_id());
get_author_feed_link(get_queried_object_id());
get_search_feed_link();

So, I’ll use one of the above in the appropriate place in my template file, generally with something like:

<?php $feed = get_category_feed_link(get_queried_object_id());
echo 'Available via RSS: <a href="'.$feed.'">'.$feed.'</a>';
unset($feed); ?>

No, this isn’t rocket science or anything too heavy, but hopefully it will save some time for those who are searching the same amount of time I needed in order to find the fix.  It’s also worth noting that the ID of the tag/category/author can replace the get_queried_object_id() if so desired, in a loop or other context.

Facebook: look, but don’t touch

Facebook is absolutely massive.  If you don’t have an account with them, I’d currently recommend that you stay away.  If you have an account, my advice at this point is that while it may not be worth removing your account, it is certainly worth limiting your exposure to the service.

Yes, I said exposure, as though it were some sort of bacterial infection.  There’s a bunch of information on the Internet; the one that caught my eye in a big way was Dan Yoder’s Top Ten Reasons You Should Quit Facebook.  The EFF also has a number of great articles related to Facebook on its Deeplink Blogs related to Social Networks.  I highly encourage everyone visiting this page to dive deeper into these articles, and for those that come in the future.

Look, but don’t touch

My advice to those who aren’t already in Facebook is that it’s best to stay away.  You’ve done alright by this point without it, and there are enough snags that it’s worth keeping away.

For those already in the system, I’m not sure that deleting your account makes all that much sense.  In many ways there is a lot of concrete value in having a Facebook account, connected to your friends and family.

With that said, I do think it’s best to not put any more information into the system, and to remove what Likes you have left.  Think of Facebook more as a read-only system, not as read-write.

Alternatives

In truth, there are countless reasonable alternatives to each of Facebook’s features, and you can rather easily find the same value outside. This may be the time to start a blog, a website, a Twitter feed, a flickr or Picasa account; or, sans all that, to just go back to email as a primary mode of communication.

There are countless other options where you can get out what you put in, without the same threats of privacy or lock-in.  Don’t click on any of the Facebook ads, and if there are people whose content you really like, softly encourage them to put their efforts somewhere else.

I’m not particularly pushing Google, though their Data Liberation Front is a wonderful initiative which puts the power back towards the user.  WordPress, additionally, makes it easy to export all your content in a couple of clicks.  Twitter has an option of protecting your content from anyone beyond the list of those who you accept.

Final thoughts

In the end, I think the solution is by a number of small movements.  With my Facebook account, I may still “Like” someone’s status from time to time, though I’m done with Community Pages or Pages.  I’m no longer letting Facebook import my data from Netflix or Twitter.  I’m no longer going to use its messaging, instant messaging, status updates, notes, wall posts, etc.  It’s up to you to decide where you want to go with all of these decisions, though I certainly do recommend less over time rather than more, in terms of any kinds of Facebook interactions.

Subtle theme update

Not moving anything around too much, though I’ve been getting tired of the strange dirt red that was there previously.  Instead, I went back to an older idea in my site before, whereby I have a few colors, one of which is selected at random and used for the header background.  I may add in more colors as time goes on, though for the time being I’m sated.

WordPress/PHP code

This isn’t rocket science, though in the case that other people want to do the same, here’s what I have.  Please adapt to fit in with whatever schemes you have in your site:

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

<?php $header_colors = array('rgb(111,111,111)', 'rgb(222,64,0)', 'rgb(0,111,222)');
$header_color = $header_colors[array_rand($header_colors)]; ?>

<style type="text/css">
#header {background-color:<?php echo $header_color; ?>;}
</style>

Add to / subtract from the $header_colors array to make changes to the set of colors which are randomly selected.  Nothing too complicated here, but it can spice things up a bit without too much work.

Blogging softwares and blogging conceptions

Have been working with WordPress a lot lately, and as of today I found some nice features of the “visual” post editor: it’s possible to drag down the editing window to expand to a larger area, which for longer entries can be quite helpful.  There’s then the “full screen” mode which similarly gives a better space to re-read and edit and write.  All in all, the WordPress system is a rather great tool, both for managing and creating content.

I still look back to my old “blog,” titled RINTA, which was much more cut down.  I had one text box into which I wrote, and I primarily used Textile markup for any sort of code or media.  That did seem to work a bit better, in terms of entries such as this where I’m leaving crumbs rather than more structured and categorized essays, as I have here.

Indeed, I do find that the form and the system of software does have a rather large impact on the way that I am writing.  With RINTA, I had a few close friends who I knew followed my writings, and in terms of the general Internet I never did the things that Google or any other traffic generator liked all that much.  I imagine, to the aggregating and filtering software out there, my content was a bit too primitive and possibly tied more closely to spam or some other similarly unworthy drivel.

Since I switched to WordPress, my numbers with Google rather improved, and I’ve been able to get more traffic from other sources by a much greater degree.  The general framework that WordPress creates is something that the Internet likes.  It’s more familiar and packaged in a more common way.  Because of that, I’ve been checking my stats much more regularly, and, eventually, thinking about finding ways to make those numbers creep up, make my audience larger.  At the end of the day it’s sort of a silly enterprise, and on the other end I’ve been a bit more reserved and concerned with making more “premium” content.  I’ve been a bit less personal, looking towards these web-crawling spider “robots.”

I don’t know that I particularly have a plan, now, seeing the above trends.  In the end, though, I know what is important to me is being able to get back into the mind set of what I had with RINTA, where I didn’t care quite as much about the structure or the numbers.  A website should be something a bit more about a legacy, I think; something created, fairly common, yet standing for years on the wave of bits passing through all these Internet tubes.

And with all of that said, I do have to say that the word “blog” really has always sounded rather dirty to me, and I hate to use it.  I try “website” or “journal” or whatever else, even though at the end of the day it’s just a word for some content and, again, by any other name my words will sound just as sweet.

Finally: a fresh theme

It took me a little while, though I finally moved on to a custom theme. It is most important to note that it is highly derivative of the original “Kubrik” WordPress theme, which is the default that ships with all installations as of late. However, it is also rather similar to my other site designs, with almost no graphical elements and a lot of careful placement.

I will hopefully get into more about the mobile version at some point.. though if you’re trying it now, this page ought to look just as good on smaller screens, as well as large.

One further step I’ve taken in this theme is to use a bit of WordPress functionality in adding a configuration menu, in the vein of this Codex page. I’m not getting into anything fancy, and anyone visiting really won’t care or even be able to notice.. though I now have my own simple menu by which I can place in my Google Analytics code and have it show up at the bottom of the page as it should. Again, that’s a topic for another day, which I hopefully will not neglect to write up in more detail. For now, I give myself a mini-yay.

Theme switchup: Journalist

I started out with this site using the wonderful Arclight theme from digitalnature; today I switched over to Journalist by Lucian E. Marin. It’s a bit more subdued, and rather clean. Who knows, maybe I’ll switch up again in the near future again. I’d really like to make my own at some point, though I’ve been lacking the time to do so in a major way, and the free offerings out there in the WP community are very good. If other people have recommendations, feel free to put your thoughts below.

I’m not looking to pay for a theme at this point, and I personally don’t feel as though that cheapens the content of what I have down on the site. If there are differing opinions on this point, of course, I’d like to hear them.

Extending WordPress Slideshow

In a previous post I had created a system for making automated slideshows using only jQuery and the built-in WordPress attachments system. While it certainly works, I today changed around the behavior to instead read the images off sequentially, rather than picking one at random.

The trouble with the random selection, at least with the way I had previously coded it, was that especially for small sets of photos, you’d get the same image twice in a row. By keeping track of a counter variable, you can easily get by this. There are, of course, many other ways to do this, though I want to share:

function advanceSlide(item_class, display_id)
{
var display = $('#' + display_id);
display.empty();

var items = $('.' + item_class);
display.append(items.eq(currentItem).clone());
display.children('.' + item_class).fadeIn();

currentItem = (currentItem + 1) % itemCount;
}

$(document).ready(function()
{
var item_class = 'gallery-item';
var display_id = 'gallery-display';
$('#gallery-1').before('<div id="' + display_id + '"></div>');
$('#' + display_id).attr('style','height:500px');
$('.' + item_class).hide();

itemCount = $('.' + item_class).size();
currentItem = 0;

advanceSlide(item_class, display_id);
setInterval("advanceSlide('" + item_class + "','" + display_id + "')", 4000);
});

The main difference is in using global variables to keep track of which image we’re on, and to keep track of how many images total we have. The modulo operator (%) is a standard method for restarting the count once it reaches a certain level, which is what you want when you reach the end of the list of images.

Although I generally do not like global variables, using them in the above (announced by having the variable declaration without the var keyword, in JavaScript) certainly does cut down on the complexity of the code.