• Skip to primary navigation
  • Skip to main content
  • Home
  • Archives

divydovy

Just another human

  • Weekly photos – 2021
  • Contact Me

web

Customising the ‘Via’ in Tweet Button for AddThis WordPress Plugin

January 24, 2012 by David Lockie

This one had me scratching my head for ages, and it was only some good investigation by @domsoar that found the answer, here: http://thenorthernedge.ca/blog/how-customize-addthis-for-your-website-or-blog-3559/.

The answer is to use a custom button and this sort of code:

 

<div class=”addthis_toolbox addthis_default_style “>

<a class=”addthis_button_facebook_like”></a>

<a class=”addthis_button_tweet” tw:via=”YOURHANDLE” tw:related=”YOURHANDLE “></a>

<a class=”addthis_button_google_plusone”></a>

<a class=”addthis_counter addthis_pill_style”></a>

</div>

The bit that actually fixes the ‘via’ reference in the Tweet is emboldened above. I had tried with the ‘via’ reference previously with no success, but the tw:related argument fixed it!

Hope this helps someone 🙂

 

Filed Under: web Tagged With: addthis, configuration, plugin, tweet button, twitter, wordpress

The importance of keeping WordPress (and plugins) updated

November 4, 2011 by David Lockie

It is very important that WordPress and any plugins and themes are kept up-to-date for several reasons:

  1. Security – this is the most important reason. WordPress is a huge target for hackers and other malicious online types – being able to hack WordPress means instant access to over 50 million websites and the ability to read their secure content, insert dodgy links or do other bad things. WordPress is continually identifying and fixing security risks and holes. These fixes are released as WordPress updates. If you don’t update your WordPress, you’re leaving known security risks in place, which means that sooner or later your site will probably be hacked. This could have serious impact on your business, as well as costing you time, effort and money to fix.
  2. Performance – the WordPress team put a lot of time and effort into making WordPress faster and more efficient. Keeping your WordPress updated means that your site is performing as well as it can.
  3. Features –  Major releases of WordPress typically include improved functionality and tools to allow you to get more from your site.
  4. User experience – Most updates to WordPress make the content management system quicker, easier and generally nicer to use, encouraging you to interact with your site more.
  5. Future-proofing –  at some point, you’re bound to want changes made to your site. Those changes might require the latest version of WordPress (for example to use a particular plugin that only works with newer versions). By updating frequently, you pick up small changes and errors that need to be attended to on an ongoing basis, keeping your site reasonably up-to-date with the core of WordPress development. If you don’t update for a year or two, you’re far more likely to suffer major disruption when you do, because all of those small and minor issues have become intertwined, making diagnosis and fixing harder and more time-consuming (and expensive).

These are the main reasons I can think of to keep WordPress updated, but there’s also a broader, more fundamental reason. Good Housekeeping. Why use the world’s leading publishing platform and then not keep it updated? It’s like buying a Mercedes and not getting it serviced. So: keep your WordPress installation up-to-date. It’s more than just software, it’s part of your business.

Filed Under: web Tagged With: maintenance, updating, wordpress

Thematic Snippet: Show full content / enable $more link in archives

October 3, 2011 by David Lockie

I can never find this incredibly useful snippet when I need it, so I’m blogging it.

If you child-theme Thematic, you’ll notice that archive and search results pages only return the excerpt rather than the full content. This snippet changes that to give your archive pages the full impact:

// Make sure thematic_content is always set to full to enable the more link
function childtheme_content($content) {
	if (is_home() || is_front_page()) {
			$content = 'full';
		} elseif (is_single()) {
			$content = 'full';
		} elseif (is_tag()) {
			$content = 'full';
		} elseif (is_search()) {
			$content = 'full';
		} elseif (is_category()) {
			$content = 'full';
		} elseif (is_author()) {
			$content = 'full';
		} elseif (is_archive()) {
			$content = 'full';
		}
	return $content;
}
add_filter('thematic_content', 'childtheme_content');

Hope someone else finds this useful!

Filed Under: web Tagged With: archives, content, PHP, snippet, thematic, wordpress

Cufón for Thematic with no plugins – improved

July 22, 2011 by David Lockie

Since I wrote the original ‘Cufon for Thematic with no plugins‘ post, I’ve learnt how to use script queueing, rather than hard-coded links. Here’s the official WP page about script queueing: http://codex.wordpress.org/Function_Reference/wp_enqueue_script if you want to find out more.

Here’s the improved version of that post, also featuring a little function to convert the doctype into XHTML Strict, which Cufon needs in order to observe CSS line-height declarations:

// Enqueue Cufon and Font JS files
if ( !is_admin() ) { // instruction to only load if it is not the admin area
// register scripts
wp_register_script('cufon-yui',
get_bloginfo('stylesheet_directory') . '/js/cufon-yui.js',
array('jquery'),
false,
false
);
wp_register_script('font-yourfont',
get_bloginfo('stylesheet_directory') . '/js/YourFont.font.js',
array('jquery', 'cufon-yui'),
false,
false
);
// enqueue scripts
wp_enqueue_script('cufon-yui');
wp_enqueue_script('font-yourfont');
}

// Cufon needs strict doctype for line-height
function childtheme_create_doctype($content) {
$content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
$content .= "\n";
$content .= '<html xmlns="http://www.w3.org/1999/xhtml"';
return $content;
}
add_filter('thematic_create_doctype', 'childtheme_create_doctype');

// Add extra scripts to head
function childtheme_head() { ?>
<!-- Cufon -->
<script type="text/javascript">
Cufon.replace('h1, h2', { fontFamily: 'YourFont' });
</script>
<?php }
add_action('wp_head', 'childtheme_head');

// Load Child Theme js file, Google Analytics
function load_childtheme_js() {?>
<script type="text/javascript"> Cufon.now(); </script>
<?php }
add_action('thematic_after','load_childtheme_js');

Any comments or corrections, please shout in the comments!

Filed Under: web Tagged With: cufon, font replacement, fonts, functions, thematic, wordpress

I’m organising WP-Brighton!

July 22, 2011 by David Lockie

I’m organising my first business event!

WP-Brighton – a WordPress event for everyone. Working with Michael Bailey and Paul Bunkham to organise this exciting event, which aims to bring together Brighton’s digital and business communities.

I won’t go on about it here, but if you want to check it out, here’s the website: www.wp-brighton.org.uk

Filed Under: web Tagged With: brighton, event, wordpress, wp-brighton

Configuring WPML to work with Thematic WordPress theme

June 27, 2011 by David Lockie

Hope this’ll save someone the same painful process of Google searching leading to broken page links and out of date instructions/screenshots.

So, you’ve got WordPress installed, Thematic as your theme or parent theme and you’ve installed WPML (I’m using v2.3.2), selected your languages and options and are now in ‘Theme and Plugins Localisation’ in the WPML menu in the CMS.

Follow these steps:

  1. Choose ‘Translate by .mo files’, but don’t select the ‘automatically load’ checkbox underneath.
  2. Save
  3. You’ll see a table below with a list of translation files that the plugin is looking for with ‘File not found’ everywhere.
  4. Go to ‘Theme Localisation‘ on the WPML site
  5. Download the language .mo files you want and save them to /wp-includes/languages
  6. Now that’s the WordPress languages done – hopefully if you now refresh the CMS page we’re on, you’ll see ‘File exists’. Ah, that feels good.
  7. Now for the Thematic language files.
  8. Go into thematic/library/languages and copy the .mo files you want to the root thematic folder
  9. Again, refresh the WPML settings page and BOOM! you should now see that all files exist.
  10. Wipe sweat from furrowed brow

I’m using WPML for a custom Thematic child theme, so I’ll post back any further findings of interest.

Filed Under: web Tagged With: compatability package, localisation, MO, thematic, theme, wordpress, wordpress multilanguage, wpml

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 6
  • Go to Next Page »

Copyright © 2021 · Revolution Pro on Genesis Framework · WordPress · Log in