Category: WordPress

  • Display WP Post Category without link

    Here is a small piece of code that will display the category name of a WordPress post without a hyperlink to the category page. Typically, the category data is retrieved with the_category( ). This function is not useful for manipulating the category name in plain text. Displaying the category in plain text is easy with get_the_category( ), however.


    <?php
    $category = get_the_category();
    echo $category[0]->cat_name;
    ?>

  • WordPress latest twitter sidebar widget

    wordpress-twitter-widgetDiscontinued! This plugin is dead, details here.

    I made a WordPress widget to display latest Twitter updates for any Twitter user in a WordPress website’s sidebar. A widget is activated just like a plugin on any “widget ready” theme and can be positioned within the sidebar using the drag and drop Widgets page in the Administration Dashboard.

    • Links @usernames, #hashtags and URLs
    • Displays up to 20 twitter updates
    • Works for any username with public tweets
    • Does not require twitter password
    • CSS friendly element IDs

    Requirements to run

    • WordPress version 3.0.0 minimum (MySQL 5 + PHP5)
    • json extension for PHP

    This project is based on some code written by Ryan Barr. I added some sauce and already have a nice idea of where the next version will progress. Thanks for introducing me to the twitter API, Ryan.

    PHP5 required

    This will be the last version of this plugin that runs uses PHP4’s DOMXML object. All future versions published to this plugin’s page on the WordPress Plugin Directory will be PHP5 only. Click here to download the last PHP4 compatible build from my server, version 0.100210 of this plugin.