wordpress

{title ? title : null}

Generate Picture Element in WordPress

3/5/2017

With responsive images you have 2 option s srcset (the default WordPress method) or the picture element. I prefer to use this so wrote a little helper to add to my WordPress Projects.

{title ? title : null}

Remove weird characters from your WordPress database

24/2/2014

Sometime you might find you end up with weird characters in you content after you migrate a WordPress data base, the following SQL code can be run. [sql]UPDATE wp_posts SET post_content = REPLACE(post_content, ‘“’, ‘“’); […]

{title ? title : null}

Disabling WordPress Automatic Updates

29/10/2013

Disabling automatic updates in WordPress is really easy. It’s as simple as adding the following line of code in your wp-config.php file: [php]define( ‘AUTOMATIC_UPDATER_DISABLED’, true );[/php] This will disable the new WordPress automatic updater, however […]

{title ? title : null}

WordPress Function to remove querystring version numebrs

16/2/2013

A really simple WordPress function to remove querystring version numbers from wp_enqueue_style and wp_enqueue_script. Just add the following code in your themes functions.php file: [php] function _remove_script_version( $src ){ $parts = explode( ‘?’, $src ); […]

{title ? title : null}

Update Site URL in WordPress

14/1/2013

If you need to move your WordPress blog to a new URL you will need to update the database, use these simple queries to do the work for you. Just replace the relevant old and new URLs, […]

{title ? title : null}

Get Featured image WordPress

10/1/2013

Nice little function to add to your themes function.php file to return the featured image of a WordPress page or post. [php] function get_feat_image($postID, $imageSize, $returnType) { $attachmentID = get_post_thumbnail_id($postID); if ($attachmentID) { $image_attributes = […]

{title ? title : null}

Automatic Copyright Year in PHP

2/1/2013

Now the new year in here, don’t forget to update your copyright year to the current year. Of even better set it in your theme automatically, and never have to do it again © <?php echo date(“Y”) […]