Difference between revisions of "Wordpress"
From Wikicliki
| Line 1: | Line 1: | ||
| + | == Homepage link == | ||
| + | |||
| + | <pre><a href="<?php bloginfo('url');?>">Home</a></pre> | ||
| + | |||
== Widgetising the menu == | == Widgetising the menu == | ||
Revision as of 10:44, 5 April 2013
Contents
Homepage link
<a href="<?php bloginfo('url');?>">Home</a>
Add this to functions.php:
register_sidebar( array(
'name' => 'Page Menu',
'id' => 'page-menu',
'before_widget' => '<div id="page-nav">',
'after_widget' => '</div>',
'before_title' => false,
'after_title' => false
) );
add_filter( 'wp_page_menu', 'my_page_menu' );
function my_page_menu( $menu ) {
dynamic_sidebar( 'page-menu' );
}
Add this to your wordpress theme where the menu should appear
<?php wp_page_menu(); ?>
Importing / exporting xml
- WordPress WXR file splitter for Mac OS X - to split xml into 2MB for upload (maximum file limit is 2MB but you can split the wxr xml into different files and upload one by one instead.
Whatever
- http://fthrwght.com/autofocus/
- http://shakenandstirredweb.com/331/introducing-our-first-free-wordpress-theme-shaken-grid
- http://www.frogsthemes.com/themes/wordpress/foliogrid-pro/
- http://wpshower.com/free-wordpress-themes/imbalance-free-wordpress-theme/
Geotagging
http://www.lucianmarica.com/stuff/geotagging-from-image-exif-data-in-wordpress/
Snippets
<?php
if ( in_category('fruit') ) {
include 'single-fruit.php';
} elseif ( in_category('vegetables') ) {
include 'single-vegetables.php';
} else {
// Continue with normal Loop
if ( have_posts() ) : while ( have_posts() ) : the_post();
// ...
}
?>
<?php if ( get_post_meta($post->ID, 'thumb', true) ) : ?>
<a href="<?php the_permalink() ?>" rel="bookmark">
<img class="thumb" src="<?php echo get_post_meta($post->ID, 'thumb', true) ?>" alt="<?php the_title(); ?>" />
</a>
<?php endif; ?>