by Nick | Nov 1, 2011 | Code
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...
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; ?>
Recent Comments