Tag Archives: Wordpress

WordPress Tip: Custom shortcode for including CSS & HTML

If you want to include HTML and/or CSS in your blog post, try adding this to your theme’s functions.php:
[php]function include_func($atts) {
extract(shortcode_atts(array(
‘html’ => ”,
‘css’ => ”,
), $atts));
if ($css!=”) {
global $stylenum;
if (!isset($stylenum)) $stylenum=0;
$thisstylename=’externalStyle’.$stylenum;
wp_register_style($thisstylename,’/’.$css);
wp_enqueue_style($thisstylename);
$stylenum++;
}
if ($html!=”) {
ob_start();
$filename=getcwd()."/".$html;
include($filename);
$output=ob_get_contents();
ob_end_clean();
return $output;
}
}
add_shortcode(‘include’,’include_func’);[/php]

Usage in a wordpress post:

Continue reading WordPress Tip: Custom shortcode for including CSS & HTML

WordPress Tip: Use Chrome’s Code Inspector to Edit HTML Inside Visual Editor

Using WordPress’ visual editor is nice, the TinyMCE Advanced Plugin makes it even more powerful.  But it’s nice to be able to go back and change the HTML.  Using the HTML tab in WordPress is not necessarily the best way to edit HTML, especially if you are interested in switching back and forth between Visual and HTML.   If you are working with a large document, the HTML tab will always start you at the top.  So every time you switch to HTML you have to search (either visually or with find) to find where you were at in the HTML.   There is a better way… Continue reading WordPress Tip: Use Chrome’s Code Inspector to Edit HTML Inside Visual Editor

Why Twitter is Not Good At Updating Facebook – Facebook Discriminates Against Apps

Lets examine a typical Twitter post as imported by FB’s Twitter app:

It Just Looks Awful

The update riddled with twitter lingo like RT (retweet), @mentions, and #hashtags.   Twitter lingo confuses Facebook-only users, and the twitter components that should be turned into links, aren’t.  This is a violation of the Twitter Display Guidelines but you probably won’t see Twitter revoking Facebook’s API key because it’s such an enormous source of referring traffic. Continue reading Why Twitter is Not Good At Updating Facebook – Facebook Discriminates Against Apps

A Desirable Use Case: Postless Blogs For Retainable Microblogging

The problem is that Twitter doesn’t retain more than 2500 of your last tweets. This that old information un-indexable by search engines, un-searchable by Twitter’s own search engine, and essentially irretrievable unless somebody retained a link or has archived the tweet. In the case where you might want to say something that is more persistent, a new method is necessary.

The second problem is that Blogs such as WordPress have post pages that usually contain some sort of information about the site being referenced. Posting a Blog that is simply a link to another site is pretty bland without some sort of summary or excerpt from the hyperlink being pointed to. I really don’t want to make my reader load that extra page, or force them to read some lame summary when I’m just trying to share a link I already summarized in the title. Continue reading A Desirable Use Case: Postless Blogs For Retainable Microblogging