Category Archives: WordPress

Website Changes During June 2013

Main Site Updates

The biggest changes were adding a YouTube player to my General MIDI page that plays some videos I made while playing karaoke (has lyrics) MIDI files in XMPlay. I also added a #okwx (Oklahoma Weather) Twitter search widget to my Weather page. I sometimes wonder if my site is slowly starting to suffer from feature creep with each button and widget that gets added. I think I’m still OK LOL. πŸ™‚

Gallery Updates

Gallery released version 3.0.8 at the end of last month which I have since upgraded my galleries to. It addressed a couple late-minute security vulnerabilities that were discovered.

Blog Updates

WordPress v3.5.2, a Maintenance and Security update, was released yesterday which I’ve upgraded my blog to. Performed my normal process of backing-up the database and file structure before applying the update.

Company of Valor Updates

I’ve been slowly going through my Company of Valor (An EverQuest guild that used to exist on the Quellious server about 9 years ago that I was the leader of.) website updating the code and correcting several issues. I think the Resources/Links page had around 50 broken links on itΒ  😯 LOL. Some of the pages there were made 13 years ago. A lot of the pages don’t have closing paragraph tags and other such coding practices that were the norm back then. It’s kind of a low priority deal so I do a few pages a day when I’m in the mood. πŸ™‚

Blog Updated to WordPress v3.5.1 and Other Website Changes

Blog Update

Just completed upgrading my blog to WordPress 3.5.1 which corrected some bugs and addressed some security issues. All I did for this update was backup my database and files and then clicked the automatic update button. No problems. Well, if this post works, then no problems. LOL πŸ™‚

Other Website Updates

January 26, 2013: Forgot to mention something rather obvious on the front page of my main website. Like my blog’s sidebar, I added the latest song I played in Winamp. Late last night (early this morning) I also modified my NASCAR page to show ESPN’s NASCAR News Feed for now as NASCAR removed their feeds from their site. Ehh, NASCAR’s loss I guess.

XMPlay LogoOther than the changes to my NASCAR page the previous post mentions, I worked on my MOD Page to have the same color and background as everything else. It made more sense back in the day when each page was stand-alone with no side menu. I also added links and information (Windows 7 users with UAC will want to read) to a new MOD player I’ve been trying called XMPlay. It plays MOD files very well. I’ve tried a few of the skins out and added the LAME Encoder so I can create MP3 files from the MOD files. I will probably install the latest version from the LAME Project and experiment with the best command line parameters.

I updated my Entertainment/Now Playing page to correct an issue I was having with the GetGlue Sticker widget. I kept getting web service errors with it (from GetGlue). I went on GetGlue’s Widget page for my account and looked at the source code they had on their page for my widgets there and added this bit of code prior to the script code line they tell you to add which seems to have done the trick:

<script type="text/javascript">
   var getglue = getglue || {};
   getglue.config = getglue.config || {};
   getglue.config.host = 'widgets.o.getglue.com';
   getglue.config.webhost = 'o.getglue.com';
</script>

To see/get these widgets, you have to be logged into their “old” or original website which, IMHO, is much better.

Those are the only updates really worth mentioning at this time. πŸ™‚

Blog Upgraded to WordPress v3.5 and Twenty Twelve Theme

I’ve upgraded my blog from WordPress v3.4.2 to v3.5 and changed over to the new default Twenty Twelve theme within the last day or so. The process went as follows:

  • Backed up the existing file structure and database on both my local development copy (I have Apache, MySQL, and PHP installed on my PC) and the one you’re viewing now.
  • Updated a couple of my plug-ins that had new versions out.
  • Updated the Twenty Ten and Twenty Eleven themes that had newer versions (I suspect to work better with the newer version of WordPress).
  • Ran the automatic upgrade to go from WordPress 3.4.2 to 3.5 which took around 10 seconds to complete.
  • Did my usual modification of the /wp-includes/vars.php file to force $is_apache to true so I don’t have to rely on the software to detect something which I know is true:
    // Server detection

    /**
     * Whether the server software is Apache or something else
     * @global bool $is_apache
     */

    // $is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false);
    $is_apache = true;

As far upgrading the WordPress core itself, that’s really all there was to it. The rest centered around working with the new Twenty Twelve theme and tweaking it to my liking. The following outlines some of the major points during my initial testing and theme tweaking:

  • The first thing I did was create a Twenty Twelve child theme and placed in an appropriate style.css (you have to) and copied over the functions.php file from my Twenty Eleven child theme. I also copied over the Twenty Twelve’s header.php and footer.php files as I knew I would be modifying them.
  • Activated my new child theme and looked at the main page. This first thing I noticed right off was that each post had a duplicate image. There were two Happy Thanksgiving images, two Veterans Day images and so on. Went poking around on the WordPress.org forums and found the reason. I needed to modify the theme’s content.php file and comment out (or remove) a line that contained the_post_thumbnail(); as follows (I modified the copy that I placed into my child theme):
17
18
19
20
21
22
23
24
         <?php
         // this was causing the featured image to show in the post:
         /* if ( ! post_password_required() && ! is_attachment() ) :
            the_post_thumbnail();
         endif;
         */
?>
         <?php if ( is_single() ) : ?>
         <h1 class="entry-title"><?php the_title(); ?></h1>

That corrected the duplicate image problem. Since I had included the post’s featured image within the post’s content, this was causing it to display again.

During this image testing, I discovered that my Gallery3 Picker plug-in had stopped working. It was not showing a Gallery3 tab in the add Media window. As it has been 2 years since any updates were made to it and the fact that I really didn’t need it. I just got rid of that plug-in.

At this point things seemed to be OK and I began to modify the child theme’s header.php and footer.php files and tweak the theme’s options (background, header, menus, widgets, etc) and CSS to suit my needs. It was during this that I noticed a lot of words at the end of a line of text were being broken up with hyphens. I’m thinking to myself, “What’s up with that!?”. I right-clicked where the text was and inspected the element to see what CSS was associated with it (using Firefox 17.0.1 in Windows 7 Pro 64bit) and this is what I saw related to word-wrapping:

.site-content article {
   word-wrap: break-word;
   -webkit-hyphens: auto;
   -moz-hyphens: auto;
   hyphens: auto;
}

Well, I was having none of this so I added the following to my child theme’s style.css file to over-ride it:

.site-content article {
   word-wrap: break-word;
   -webkit-hyphens: none;
   -moz-hyphens: none;
   hyphens: none;
}

That stopped the hyphenations from occurring while still breaking up really long words that are too big for the width of the post’s content. For more information about this hyphenation business: Mozilla Development Network: hyphens.

That’s been the major stuff worth noting. The other CSS tweaks for font colors and such are just personal taste and everyone’s going to have their own opinion on what looks the best. πŸ™‚ If I discover some other bizarre thing related to the upgrade or new theme I’ll make a post then.

Excluding Categories from Different Parts of WordPress

Update January 18, 2016: Thought I would mention that if you also want to remove the categories from the Archives drop-down, check out my How To Exclude Categories in WordPress Archives Drop-down post.

Update January 24, 2015: I discovered a bug with the code below. I added an is_admin() exception so the post listings in the admin section would still work properly. Without the exception, the Category filter would fail to work. I actually created a WordPress Support thread when I noticed it.


For the longest time I had been using the Advanced Category Excluder plug-in to keep a couple post categories from showing on the blog’s home page, RSS feed, search, and monthly archive views. Well, after my webhost upgraded the server to PHP 5.3.17 from PHP 5.2.X it broke that plug-in. After searching around for some answers, I tried out the Simply Exclude plug-in which did work; however, it had a couple issues. One problem was that if I excluded a category from showing in the archive view or the category drop-down widget, it broke the permalink for categories where the address bar would show /?cat=6 instead of /category/dentist/ for example. It also excluded the category from both the monthly archive view and the category view itself. I did some more searching around and came across this WordPress Codex article about Category Exclusion. I adapted the code there and placed the following 8 lines of code into my theme’s functions.php file (info on using a theme’s functions.php):

function remove_my_categories( $wp_query ) {
  // 61 = Daily Tweets, 74 = Testing
  $remove_cat = '-61,-74';

  // remove from archives (except category archives), feeds, search, and home page, but not admin areas
  if( (is_home() || is_feed() || is_search() || ( is_archive() &amp;&amp; !is_category() )) &amp;&amp; !is_admin()) {
    set_query_var('cat', $remove_cat);
    //which is merely the more elegant way to write:
    //$wp_query-&gt;;set('cat', '-' . $remove_cat);
  }
}

add_action('pre_get_posts', 'remove_my_categories' );

That’s all I needed to exclude those categories’ posts from showing on the home page, RSS feeds, search results, and the monthly archives! I can still select the category from the category drop-down list and view it in the category context. Needless to say, I’ve removed both of those plug-ins from my blog.

Hopefully this information will help some others out that run into a similar situation. πŸ™‚

Blog Updated to WordPress Version 3.4.2 and Other Changes.

I just finished updating my blog to WordPress Version 3.4.2 which is a maintenance and security update. This post is just as much a test of the upgrade as it is anything. It’s been a long time since I made a post about upgrading WordPress because there’s really not much to say about it. All I do is backup the database and files, click “update” in the admin section, and I’m done. The whole process takes like 30 seconds. Since only modified files are updated now, the code changes I make to vars.php and wp-login.php rarely need to be added back in.

I used to add little news snippets on the front of my main website every time I changed something on one of the pages. Most recently, I changed the Entertainment/Now Playing page where I merged the TV and Movie section and added the GetGlue Check-In and Sticker Widgets on the side to show what I’ve watched most recently. I’ve probably made other tweaks here and there but I can’t remember where and what LOL. I suspect after I hit publish on this post I’ll uncover some issues that I’ll need to address.

Hope everyone had a great Labor Day Weekend and I’m looking forward to the NASCAR Sprint Cup race this weekend at Richmond to determine the final chase line-up! πŸ™‚