WordPress Dynamic Copyright Date
Add the following your your footer.php file <?php $today = date("Y"); echo $today; ?>
Show Related Posts Without A Plugin
Add the following code to your single.php. <?php $tags = wp_get_post_tags($post->ID); if ($tags) { $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; $args=array( ‘tag__in’ => $tag_ids, ‘post__not_in’ =>…
Adding your RSS Feed to Your Customers WordPress Dashboard
This can be used to add your company RSS feed to your customers WordPress dashboard. Simply add this code to the functions.php file. <?php function shaken_rss_output(){ echo ‘<div class="rss-widget">’; wp_widget_rss_output(array( ‘url’ =>…
Automatically Create Meta Description From Your Posts Content
Add this to your functions.php file and it will automatically create a meta description from your WordPress post. <?php function create_meta_desc() { global $post; if (!is_single()) { return; } $meta = strip_tags($post->post_content); $meta =…
Automatically show child pages and custom fields WorldPress
This code will allow you to automatically show child pages including custom fields in this case one called ‘desc’ You will need to add this code to your template file for example page.php <?php $child_pages = $wpdb->get_results("SELECT * FROM…
Magento weight vs destination table rate shipping costs example
Here is an example of weight vs destination pricing for UK: Country,Region/State,"Zip/Postal Code","Weight (and above)","Shipping Price" GBR,*,,1000.0000,75.0000 GBR,*,,65.0000,50.5000 GBR,*,,50.0000,40.0000…
How to add custom attributes to transactional emails in Magento 1.5
Follow this example to add custom attributes to transactional emails in Magento 1.5 (may work in older version as well) Create a new folder called templates in the directory app\design\frontend\default\default\ and create a new file called orderemail.phtml. Final URL…
mod_rewrites and SEO friendly Magento URLs
To enable mod_rewrites and SEO friendly Magento URLs which removes the index.php from the URL of your Magento store, you should enable mod_rewrites. Step 1 Find this in the .htaccess file in the root of your website. ## you can put here your magento root folder ##…
Display a Random Header Image on Your WordPress Blog
Upload some images named 1.jpg, 2.jpg, 3.jpg and so on to your your wp-content/themes/yourtheme/images directory. Open header.php and paste the following code in it: <?php $num = rand(1,10); //Get a random number between 1 and 10, assuming 10 is the total number of…
Remove RSS feeds from WordPress site
Add this to your functions.php file to disable any RSS feeds. function fb_disable_feed() { wp_die( __(‘No feed available,please visit our <a href="’. get_bloginfo(‘url’) .’">homepage</a>!’) ); } add_action(‘do_feed’, ‘fb_disable_feed’, 1);…
Recent Comments