by Nick | Mar 13, 2011 | Code
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...
by Nick | Mar 3, 2011 | Code
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);...
by Nick | Mar 1, 2011 | Code
Use this code to stop the title of the page such as ‘Home’ from being displayed as the H1 on the homepage. <?php if (!is_page('Home')) { ?> <h1><?php the_title(); ?></h1> <?php }...
by Nick | Mar 1, 2011 | Code
Use this to target code if a certain page exists, useful to show gallery images in a sidebar if there is a gallery page. <?php if(get_page_by_title('Gallery')) : {code here} endif; ?>
by Nick | Feb 19, 2011 | Code
Add the following to the functions.php file <?php function fn_googleMaps($atts, $content = null) { extract(shortcode_atts(array( "width" => '640', "height" => '480', "src" => '' ), $atts)); return ''; }...
by Nick | Feb 19, 2011 | Code
Add this to your functions.php file function the_breadcrumb() { echo '<ul id="crumbs">'; if (!is_home()) { echo '<li><a href="'; echo get_option('home'); echo '">'; echo 'Home'; echo "</a></li>"; if...
Recent Comments